package com.fintech.datagroud.service.impl;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.fintech.common.service.BaseServiceImpl;
import com.fintech.datagroud.dao.moxie.IntMxAccountBaseInfoMapper;
import com.fintech.datagroud.dao.moxie.IntMxActiveDegreeDetailMapper;
import com.fintech.datagroud.dao.moxie.IntMxActiveDegressMapper;
import com.fintech.datagroud.dao.moxie.IntMxAlipayBankInfoMapper;
import com.fintech.datagroud.dao.moxie.IntMxAlipayContactsMapper;
import com.fintech.datagroud.dao.moxie.IntMxAlipayDeliverAddressesMapper;
import com.fintech.datagroud.dao.moxie.IntMxAlipayJiaofeiInfoMapper;
import com.fintech.datagroud.dao.moxie.IntMxAlipayJiebeiMapper;
import com.fintech.datagroud.dao.moxie.IntMxAlipayRecentTradersMapper;
import com.fintech.datagroud.dao.moxie.IntMxAlipayUserInfoMapper;
import com.fintech.datagroud.dao.moxie.IntMxAlipayWealthMapper;
import com.fintech.datagroud.dao.moxie.IntMxAlipayZmsCoreMapper;
import com.fintech.datagroud.dao.moxie.IntMxAlipayZmsDoubtfulInfoMapper;
import com.fintech.datagroud.dao.moxie.IntMxBasicInfoCheckItemsMapper;
import com.fintech.datagroud.dao.moxie.IntMxBillRecordMapper;
import com.fintech.datagroud.dao.moxie.IntMxBillsMonthMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallAnalysisMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallContactDetailMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallDetailsMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallDetailsSubMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallDurationDetailMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallFamilyDetailMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallLocationDetailMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallLocationTop3Mapper;
import com.fintech.datagroud.dao.moxie.IntMxCallNumTop3Mapper;
import com.fintech.datagroud.dao.moxie.IntMxCallServiceDetailMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallThirdPartyDetailMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallTimeDetailMapper;
import com.fintech.datagroud.dao.moxie.IntMxCallsMapper;
import com.fintech.datagroud.dao.moxie.IntMxCheckSearchInfoMapper;
import com.fintech.datagroud.dao.moxie.IntMxConsumptionAnalysisMapper;
import com.fintech.datagroud.dao.moxie.IntMxConsumptionDetailMapper;
import com.fintech.datagroud.dao.moxie.IntMxDataSourceMapper;
import com.fintech.datagroud.dao.moxie.IntMxDataUsageDetailsSubMapper;
import com.fintech.datagroud.dao.moxie.IntMxDataUsageMonthSubMapper;
import com.fintech.datagroud.dao.moxie.IntMxFamilynetMemberMapper;
import com.fintech.datagroud.dao.moxie.IntMxFamilynetNumberMapper;
import com.fintech.datagroud.dao.moxie.IntMxFriendCircleMapper;
import com.fintech.datagroud.dao.moxie.IntMxLoanInfoMapper;
import com.fintech.datagroud.dao.moxie.IntMxLoanRepayRecordMapper;
import com.fintech.datagroud.dao.moxie.IntMxLocalCallDetailCountMapper;
import com.fintech.datagroud.dao.moxie.IntMxMobileCallDetailCountMapper;
import com.fintech.datagroud.dao.moxie.IntMxPackageInfoMapper;
import com.fintech.datagroud.dao.moxie.IntMxPackageItemsMapper;
import com.fintech.datagroud.dao.moxie.IntMxRechargeItemsMapper;
import com.fintech.datagroud.dao.moxie.IntMxRechargeMapper;
import com.fintech.datagroud.dao.moxie.IntMxRiskAnalysisMapper;
import com.fintech.datagroud.dao.moxie.IntMxRiskCheckItemMapper;
import com.fintech.datagroud.dao.moxie.IntMxSmsDetailsSubMapper;
import com.fintech.datagroud.dao.moxie.IntMxSmsesSubMapper;
import com.fintech.datagroud.dao.moxie.IntMxUserBasicInfoMapper;
import com.fintech.datagroud.dao.moxie.IntMxUserInfoMapper;
import com.fintech.datagroud.dao.moxie.v2.IntMxv2PersistenceMapper;
import com.fintech.datagroud.entity.moxie.IntMxLocalCallDetailCount;
import com.fintech.datagroud.entity.moxie.IntMxMobileCallDetailCount;
import com.fintech.datagroud.service.DGMoXieService;
import com.fintech.third.dao.moxie.IntMxBehaviorCheckMapper;
import com.fintech.third.model.moxie.alipay.MXAlipayBankInfo;
import com.fintech.third.model.moxie.alipay.MXAlipayContacts;
import com.fintech.third.model.moxie.alipay.MXAlipayDeliverAddresses;
import com.fintech.third.model.moxie.alipay.MXAlipayJiaoFeiInfo;
import com.fintech.third.model.moxie.alipay.MXAlipayJieBei;
import com.fintech.third.model.moxie.alipay.MXAlipayRecentTraders;
import com.fintech.third.model.moxie.alipay.MXAlipayReport;
import com.fintech.third.model.moxie.alipay.MXAlipayUserInfo;
import com.fintech.third.model.moxie.alipay.MXAlipayWealth;
import com.fintech.third.model.moxie.alipay.MXAlipayZmsCore;
import com.fintech.third.model.moxie.alipay.MXAlipayZmsDoubtfulInfo;
import com.fintech.third.model.moxie.alipay.MXAlipayZmsReport;
import com.fintech.third.model.moxie.carries.AllDataDetails;
import com.fintech.third.model.moxie.carries.NumberReport;
import com.fintech.third.model.moxie.carries.VoiceCall;
import com.fintech.third.model.moxie.carriesv2.MXApplicationPoint;
import com.fintech.third.model.moxie.carriesv2.MXBasicCheckItem;
import com.fintech.third.model.moxie.carriesv2.MXBasicInfo;
import com.fintech.third.model.moxie.carriesv2.MXBehaviorCheck;
import com.fintech.third.model.moxie.carriesv2.MXCheckBlackInfo;
import com.fintech.third.model.moxie.carriesv2.MXCheckSearchInfo;
import com.fintech.third.model.moxie.carriesv2.MXDetailItem;
import com.fintech.third.model.moxie.carriesv2.MXReport;
import com.fintech.third.model.moxie.carriesv2.MXUserInfoCheck;
import com.fintech.third.model.moxie.dataprovide.IntMxAccountBaseInfo;
import com.fintech.third.model.moxie.dataprovide.IntMxActiveDegreeDetail;
import com.fintech.third.model.moxie.dataprovide.IntMxActiveDegress;
import com.fintech.third.model.moxie.dataprovide.IntMxAlipayBankInfo;
import com.fintech.third.model.moxie.dataprovide.IntMxAlipayContacts;
import com.fintech.third.model.moxie.dataprovide.IntMxAlipayDeliverAddresses;
import com.fintech.third.model.moxie.dataprovide.IntMxAlipayJiaofeiInfo;
import com.fintech.third.model.moxie.dataprovide.IntMxAlipayJiebei;
import com.fintech.third.model.moxie.dataprovide.IntMxAlipayRecentTraders;
import com.fintech.third.model.moxie.dataprovide.IntMxAlipayUserInfo;
import com.fintech.third.model.moxie.dataprovide.IntMxAlipayWealth;
import com.fintech.third.model.moxie.dataprovide.IntMxAlipayZmsCore;
import com.fintech.third.model.moxie.dataprovide.IntMxAlipayZmsDoubtfulInfo;
import com.fintech.third.model.moxie.dataprovide.IntMxBasicInfoCheckItems;
import com.fintech.third.model.moxie.dataprovide.IntMxBillRecord;
import com.fintech.third.model.moxie.dataprovide.IntMxBillsMonth;
import com.fintech.third.model.moxie.dataprovide.IntMxCallAnalysis;
import com.fintech.third.model.moxie.dataprovide.IntMxCallContactDetail;
import com.fintech.third.model.moxie.dataprovide.IntMxCallDetails;
import com.fintech.third.model.moxie.dataprovide.IntMxCallDurationDetail;
import com.fintech.third.model.moxie.dataprovide.IntMxCallFamilyDetail;
import com.fintech.third.model.moxie.dataprovide.IntMxCallLocationDetail;
import com.fintech.third.model.moxie.dataprovide.IntMxCallLocationTop3;
import com.fintech.third.model.moxie.dataprovide.IntMxCallNumTop3;
import com.fintech.third.model.moxie.dataprovide.IntMxCallServiceDetail;
import com.fintech.third.model.moxie.dataprovide.IntMxCallThirdPartyDetail;
import com.fintech.third.model.moxie.dataprovide.IntMxCallTimeDetail;
import com.fintech.third.model.moxie.dataprovide.IntMxCalls;
import com.fintech.third.model.moxie.dataprovide.IntMxCheckBlackInfo;
import com.fintech.third.model.moxie.dataprovide.IntMxConsumptionAnalysis;
import com.fintech.third.model.moxie.dataprovide.IntMxConsumptionDetail;
import com.fintech.third.model.moxie.dataprovide.IntMxDataSource;
import com.fintech.third.model.moxie.dataprovide.IntMxDataUsageDetails;
import com.fintech.third.model.moxie.dataprovide.IntMxDataUsageMonth;
import com.fintech.third.model.moxie.dataprovide.IntMxFamilynetMember;
import com.fintech.third.model.moxie.dataprovide.IntMxFamilynetNumber;
import com.fintech.third.model.moxie.dataprovide.IntMxFriendCircle;
import com.fintech.third.model.moxie.dataprovide.IntMxLoanInfo;
import com.fintech.third.model.moxie.dataprovide.IntMxLoanRepayRecord;
import com.fintech.third.model.moxie.dataprovide.IntMxPackageInfo;
import com.fintech.third.model.moxie.dataprovide.IntMxPackageItems;
import com.fintech.third.model.moxie.dataprovide.IntMxRecharge;
import com.fintech.third.model.moxie.dataprovide.IntMxRechargeItems;
import com.fintech.third.model.moxie.dataprovide.IntMxRiskAnalysis;
import com.fintech.third.model.moxie.dataprovide.IntMxRiskCheckItem;
import com.fintech.third.model.moxie.dataprovide.IntMxSmsDetails;
import com.fintech.third.model.moxie.dataprovide.IntMxSmses;
import com.fintech.third.model.moxie.dataprovide.IntMxUserBasicInfo;
import com.fintech.third.model.moxie.dataprovide.IntMxUserInfo;
import com.fintech.third.model.moxie.fund.UserFundRecord;
import com.fintech.third.utils.SortUtil;
import com.fintech.third.utils.ThirdPropertiesInitUtil;
import com.marvels.common.utils.MarvelsLogUtil;

import cn.hutool.core.bean.BeanUtil;

@Service("dGMoXieService")
public class DGMoXieServiceImpl extends BaseServiceImpl implements DGMoXieService {

	@Autowired
	private IntMxUserBasicInfoMapper userBaseInfoMapper;
	@Autowired
	private IntMxDataSourceMapper dataResourceMapper;
	@Autowired
	private IntMxBasicInfoCheckItemsMapper basicInfoCheckMapper;
	@Autowired
	private IntMxFriendCircleMapper friendCircleMapper;
	@Autowired
	private IntMxCallNumTop3Mapper callNumTop3Mapper;
	@Autowired
	private IntMxCallLocationTop3Mapper callLocationTop3Mapper;
	@Autowired
	private IntMxRiskAnalysisMapper riskAnalysisMapper;
	@Autowired
	private IntMxRiskCheckItemMapper riskCheckMapper;
	@Autowired
	private IntMxActiveDegressMapper activeDegressMapper;
	@Autowired
	private IntMxConsumptionAnalysisMapper consumpAnalyseMapper;
	@Autowired
	private IntMxCallAnalysisMapper callAnalyseMapper;
	@Autowired
	private IntMxCallContactDetailMapper callContDetailMapper;
	@Autowired
	private IntMxCallDurationDetailMapper callDuraDetailMapper;
	@Autowired
	private IntMxCallLocationDetailMapper callLocatDetailMapper;
	@Autowired
	private IntMxCallTimeDetailMapper callTimeDetailMapper;
	@Autowired
	private IntMxCallThirdPartyDetailMapper callThirdDetailMapper;
	@Autowired
	private IntMxCallFamilyDetailMapper callFamilyDetailMapper;
	@Autowired
	private IntMxCallServiceDetailMapper callServiceDetailMapper;
	@Autowired
	private IntMxActiveDegreeDetailMapper activeDegreeDetailMapper;
	@Autowired
	private IntMxConsumptionDetailMapper consumpDetailMapper;
	@Autowired
	private IntMxAccountBaseInfoMapper acctBaseInfoMapper;
	@Autowired
	private IntMxPackageInfoMapper packageInfoMapper;
	@Autowired
	private IntMxPackageItemsMapper packageItemMapper;
	@Autowired
	private IntMxFamilynetNumberMapper familyNetNumMapper;
	@Autowired
	private IntMxFamilynetMemberMapper familyNetMemberMapper;
	@Autowired
	private IntMxRechargeMapper rechargeMapper;
	@Autowired
	private IntMxRechargeItemsMapper rechargeItemsMapper;
	@Autowired
	private IntMxBillsMonthMapper billMonthMapper;
	@Autowired
	private IntMxCallsMapper callMapper;
	@Autowired
	private IntMxCallDetailsMapper callDetailMapper;
	@Autowired
	private IntMxCallDetailsSubMapper callDetailSubMapper;

	@Autowired
	private IntMxSmsesSubMapper smsSubMapper;
	@Autowired
	private IntMxSmsDetailsSubMapper smsDetailSubMapper;

	@Autowired
	private IntMxDataUsageMonthSubMapper dataUsageMSubMapper;
	@Autowired
	private IntMxDataUsageDetailsSubMapper dataUsageDetailSubMapper;
	@Autowired
	private IntMxUserInfoMapper userInfoMapper;
	@Autowired
	private IntMxBillRecordMapper billRecordMapper;
	@Autowired
	private IntMxLoanInfoMapper loanInfoMapper;
	@Autowired
	private IntMxLoanRepayRecordMapper loanRepayRecordMapper;

	@Autowired
	private IntMxLocalCallDetailCountMapper intMxLocalCallDetailCountMapper;

	@Autowired
	private IntMxMobileCallDetailCountMapper intMxMobileCallDetailCountMapper;

	@Autowired
	private IntMxCallAnalysisMapper intMxCallAnalysisMapper;

	@Autowired
	private IntMxv2PersistenceMapper intMxv2PersistenceMapper;
	
	@Autowired
	private IntMxAlipayUserInfoMapper intMxAlipayUserInfoMapper;
	@Autowired
	private IntMxAlipayWealthMapper intMxAlipayWealthMapper;
	@Autowired
	private IntMxAlipayBankInfoMapper intMxAlipayBankInfoMapper;
	@Autowired
	private IntMxAlipayContactsMapper intMxAlipayContactsMapper;
	@Autowired
	private IntMxAlipayDeliverAddressesMapper intMxAlipayDeliverAddressesMapper;
	@Autowired
	private IntMxAlipayJiaofeiInfoMapper intMxAlipayJiaofeiInfoMapper;
	@Autowired
	private IntMxAlipayJiebeiMapper intMxAlipayJiebeiMapper;
	@Autowired
	private IntMxAlipayRecentTradersMapper intMxAlipayRecentTradersMapper;
	@Autowired
	private IntMxAlipayZmsCoreMapper intMxAlipayZmsCoreMapper;
	@Autowired
	private IntMxAlipayZmsDoubtfulInfoMapper intMxAlipayZmsDoubtfulInfoMapper;
	@Autowired
	private IntMxCheckSearchInfoMapper intMxCheckSearchInfoMapper;
	@Autowired
	IntMxBehaviorCheckMapper intMxBehaviorCheckMapper;
	
	// 用户报告
	@Override
	public boolean obtainUserMobileReport(NumberReport numberReport, String tokenId, String loanId, String message) throws Exception {

		// 01用户基本信息-基本信息 int_mx_user_basic_info
		IntMxUserBasicInfo userBasicInfo = new IntMxUserBasicInfo();
		userBasicInfo.setSerialNum(tokenId);
		userBasicInfo.setLoanId(loanId);
		userBasicInfo.setMessage(message);
		if (null != numberReport.getUserBaseInfo()) {
			userBasicInfo.setName(numberReport.getUserBaseInfo().getName());
			userBasicInfo.setIdcard(numberReport.getUserBaseInfo().getIdcard());
			userBasicInfo.setNameFromCustom(numberReport.getUserBaseInfo().getNameFromCustom());
			userBasicInfo.setIdcardFromCustom(numberReport.getUserBaseInfo().getIdcardFromCustom());
			userBasicInfo.setMobile(numberReport.getUserBaseInfo().getMobile());
			userBasicInfo.setGender(numberReport.getUserBaseInfo().getGender());
			userBasicInfo.setAge(numberReport.getUserBaseInfo().getAge());
			userBasicInfo.setConstellation(numberReport.getUserBaseInfo().getConstellation());
			userBasicInfo.setEmail(numberReport.getUserBaseInfo().getEmail());
			userBasicInfo.setAddress(numberReport.getUserBaseInfo().getAddress());
			userBasicInfo.setNativePlace(numberReport.getUserBaseInfo().getNativePlace());
			userBasicInfo.setLiveAddress(numberReport.getUserBaseInfo().getLiveAddress());
			userBasicInfo.setWorkAddress(numberReport.getUserBaseInfo().getWorkAddress());
			userBasicInfo.setGmtCreate(Calendar.getInstance().getTime());
			userBaseInfoMapper.insertSelective(userBasicInfo);
		}

		// 01用户基本信息-数据来源 int_mx_data_resource
		IntMxDataSource dataResource = new IntMxDataSource();
		dataResource.setSerialNum(tokenId);
		dataResource.setLoanId(loanId);
		if (null != numberReport.getDatesource()) {
			dataResource.setSourceName(numberReport.getDatesource().getSourceName());
			dataResource.setDataType(numberReport.getDatesource().getDataType());
			dataResource.setDataGainTime(numberReport.getDatesource().getDataGainTime());
			dataResource.setGmtCreate(Calendar.getInstance().getTime());
			dataResourceMapper.insertSelective(dataResource);
		}
		// 01用户基本信息-基础信息检查项
		IntMxBasicInfoCheckItems basicInfoCheck = new IntMxBasicInfoCheckItems();

		if (null != numberReport.getBasicInfoCheckItems() && !numberReport.getBasicInfoCheckItems().isEmpty()) {
			for (int i = 0; i < numberReport.getBasicInfoCheckItems().size(); i++) {
				if ("idcard_check".equals(numberReport.getBasicInfoCheckItems().get(i).getCheckItem())) {
					basicInfoCheck.setIdcardCheck(numberReport.getBasicInfoCheckItems().get(i).getResult());
				}
				if ("email_check".equals(numberReport.getBasicInfoCheckItems().get(i).getCheckItem())) {
					basicInfoCheck.setEmailChek(numberReport.getBasicInfoCheckItems().get(i).getResult());
				}
				if ("address_check".equals(numberReport.getBasicInfoCheckItems().get(i).getCheckItem())) {
					basicInfoCheck.setAddressCheck(numberReport.getBasicInfoCheckItems().get(i).getResult());
				}
				if ("idcard_match".equals(numberReport.getBasicInfoCheckItems().get(i).getCheckItem())) {
					basicInfoCheck.setIdcardMatch(numberReport.getBasicInfoCheckItems().get(i).getResult());
				}
				if ("name_match".equals(numberReport.getBasicInfoCheckItems().get(i).getCheckItem())) {
					basicInfoCheck.setNameMatch(numberReport.getBasicInfoCheckItems().get(i).getResult());
				}
				if ("call_data_check".equals(numberReport.getBasicInfoCheckItems().get(i).getCheckItem())) {
					basicInfoCheck.setCallDataCheck(numberReport.getBasicInfoCheckItems().get(i).getResult());
				}
			}
			// 写表
			basicInfoCheck.setSerialNum(tokenId);
			basicInfoCheck.setLoanId(loanId);
			basicInfoCheck.setGmtCreate(Calendar.getInstance().getTime());
			basicInfoCheckMapper.insertSelective(basicInfoCheck);
		}

		// 02朋友圈-朋友圈信息 int_mx_friend_circle
		IntMxFriendCircle friendCircle = new IntMxFriendCircle();
		friendCircle.setSerialNum(tokenId);
		friendCircle.setLoanId(loanId);
		if (null != numberReport.getFriendCircle()) {
			friendCircle.setFriendNum3m(numberReport.getFriendCircle().getFriendNum3m());
			friendCircle.setFriendNum6m(numberReport.getFriendCircle().getFriendNum6m());
			friendCircle.setGoodFriendNum3m(numberReport.getFriendCircle().getGoodFriendNum3m());
			friendCircle.setGoodFriendNum6m(numberReport.getFriendCircle().getGoodFriendNum6m());
			friendCircle.setFriendCityCenter3m(numberReport.getFriendCircle().getFriendCityCenter3m());
			friendCircle.setFriendCityCenter6m(numberReport.getFriendCircle().getFriendCityCenter6m());
			friendCircle.setIsCityMatchFriendCityCenter3m(
					numberReport.getFriendCircle().getIsCityMatchFriendCityCenter3m());
			friendCircle.setIsCityMatchFriendCityCenter6m(
					numberReport.getFriendCircle().getIsCityMatchFriendCityCenter6m());
			friendCircle.setGmtCreate(Calendar.getInstance().getTime());
			friendCircleMapper.insertSelective(friendCircle);

			// 02朋友圈-联系人Top3 int_mx_call_num_top3

			if (null != numberReport.getFriendCircle().getCallNumTop33m()
					&& !numberReport.getFriendCircle().getCallNumTop33m().isEmpty()) {
				List<IntMxCallNumTop3> intMxCallNumTop3List = new ArrayList<IntMxCallNumTop3>();
				for (int i = 0; i < numberReport.getFriendCircle().getCallNumTop33m().size(); i++) {
					IntMxCallNumTop3 callNumTop3 = new IntMxCallNumTop3();
					callNumTop3.setOrderNum(i + 1);
					callNumTop3.setCity(numberReport.getFriendCircle().getCallNumTop33m().get(i).getCity());
					callNumTop3.setPeerNumber(
							numberReport.getFriendCircle().getCallNumTop33m().get(i).getPeerNumber());
					callNumTop3.setCallNum(numberReport.getFriendCircle().getCallNumTop33m().get(i).getCallNum());
					callNumTop3.setCallTime(numberReport.getFriendCircle().getCallNumTop33m().get(i).getCallTime());
					callNumTop3.setDialNum(numberReport.getFriendCircle().getCallNumTop33m().get(i).getDialNum());
					callNumTop3
							.setDialedNum(numberReport.getFriendCircle().getCallNumTop33m().get(i).getDialedNum());
					callNumTop3.setDataType("近三个月");

					callNumTop3.setSerialNum(tokenId);
					callNumTop3.setLoanId(loanId);
					callNumTop3.setGmtCreate(Calendar.getInstance().getTime());

					intMxCallNumTop3List.add(callNumTop3);

				}
				if (intMxCallNumTop3List != null && intMxCallNumTop3List.size() > 0) {
					callNumTop3Mapper.insertSelective(intMxCallNumTop3List);
				}
				intMxCallNumTop3List.clear();
				intMxCallNumTop3List = null;
			}

			if (null != numberReport.getFriendCircle().getCallNumTop36m()
					&& !numberReport.getFriendCircle().getCallNumTop36m().isEmpty()) {
				List<IntMxCallNumTop3> intMxCallNumTop36mList = new ArrayList<IntMxCallNumTop3>();
				for (int i = 0; i < numberReport.getFriendCircle().getCallNumTop36m().size(); i++) {
					IntMxCallNumTop3 callNumTop3 = new IntMxCallNumTop3();
					callNumTop3.setOrderNum(i + 1);
					callNumTop3.setCity(numberReport.getFriendCircle().getCallNumTop36m().get(i).getCity());
					callNumTop3.setPeerNumber(
							numberReport.getFriendCircle().getCallNumTop36m().get(i).getPeerNumber());
					callNumTop3.setCallNum(numberReport.getFriendCircle().getCallNumTop36m().get(i).getCallNum());
					callNumTop3.setCallTime(numberReport.getFriendCircle().getCallNumTop36m().get(i).getCallTime());
					callNumTop3.setDialNum(numberReport.getFriendCircle().getCallNumTop36m().get(i).getDialNum());
					callNumTop3
							.setDialedNum(numberReport.getFriendCircle().getCallNumTop36m().get(i).getDialedNum());
					callNumTop3.setDataType("近六个月");

					callNumTop3.setSerialNum(tokenId);
					callNumTop3.setLoanId(loanId);
					callNumTop3.setGmtCreate(Calendar.getInstance().getTime());
					intMxCallNumTop36mList.add(callNumTop3);
				}
				if (intMxCallNumTop36mList != null && intMxCallNumTop36mList.size() > 0) {
					callNumTop3Mapper.insertSelective(intMxCallNumTop36mList);
				}
				intMxCallNumTop36mList.clear();
				intMxCallNumTop36mList = null;
			}
			// 02朋友圈-联系人号码归属地Top3 int_mx_call_location_top3

			if (null != numberReport.getFriendCircle().getCallLocationTop3m()
					&& !numberReport.getFriendCircle().getCallLocationTop3m().isEmpty()) {
				List<IntMxCallLocationTop3> intMxCallLocationTop3List = new ArrayList<IntMxCallLocationTop3>();
				for (int i = 0; i < numberReport.getFriendCircle().getCallLocationTop3m().size(); i++) {
					IntMxCallLocationTop3 callLocationTop3 = new IntMxCallLocationTop3();
					callLocationTop3.setOrderNum(i + 1);
					callLocationTop3
							.setCity(numberReport.getFriendCircle().getCallLocationTop3m().get(i).getCity());
					callLocationTop3
							.setCallNum(numberReport.getFriendCircle().getCallLocationTop3m().get(i).getCallNum());
					callLocationTop3.setPeerNumberCount(
							numberReport.getFriendCircle().getCallLocationTop3m().get(i).getPeerNumberCount());
					callLocationTop3.setCallTime(
							numberReport.getFriendCircle().getCallLocationTop3m().get(i).getCallTime());
					callLocationTop3
							.setDialNum(numberReport.getFriendCircle().getCallLocationTop3m().get(i).getDialNum());
					callLocationTop3.setDialedNum(
							numberReport.getFriendCircle().getCallLocationTop3m().get(i).getDialedNum());
					callLocationTop3.setDataType("近三个月");
					callLocationTop3.setSerialNum(tokenId);
					callLocationTop3.setLoanId(loanId);
					callLocationTop3.setGmtCreate(Calendar.getInstance().getTime());
					intMxCallLocationTop3List.add(callLocationTop3);

				}
				if (intMxCallLocationTop3List != null && intMxCallLocationTop3List.size() > 0) {
					callLocationTop3Mapper.insertSelective(intMxCallLocationTop3List);
				}
				intMxCallLocationTop3List.clear();
				intMxCallLocationTop3List = null;
			}
			if (null != numberReport.getFriendCircle().getCallLocationTop6m()
					&& !numberReport.getFriendCircle().getCallLocationTop6m().isEmpty()) {
				List<IntMxCallLocationTop3> intMxCallLocationTop6mList = new ArrayList<IntMxCallLocationTop3>();
				for (int i = 0; i < numberReport.getFriendCircle().getCallLocationTop6m().size(); i++) {
					IntMxCallLocationTop3 callLocationTop3 = new IntMxCallLocationTop3();
					callLocationTop3.setOrderNum(i + 1);
					callLocationTop3
							.setCity(numberReport.getFriendCircle().getCallLocationTop6m().get(i).getCity());
					callLocationTop3
							.setCallNum(numberReport.getFriendCircle().getCallLocationTop6m().get(i).getCallNum());
					callLocationTop3.setPeerNumberCount(
							numberReport.getFriendCircle().getCallLocationTop6m().get(i).getPeerNumberCount());
					callLocationTop3.setCallTime(
							numberReport.getFriendCircle().getCallLocationTop6m().get(i).getCallTime());
					callLocationTop3
							.setDialNum(numberReport.getFriendCircle().getCallLocationTop6m().get(i).getDialNum());
					callLocationTop3.setDialedNum(
							numberReport.getFriendCircle().getCallLocationTop6m().get(i).getDialedNum());
					callLocationTop3.setDataType("近六个月");
					callLocationTop3.setSerialNum(tokenId);
					callLocationTop3.setLoanId(loanId);
					callLocationTop3.setGmtCreate(Calendar.getInstance().getTime());
					intMxCallLocationTop6mList.add(callLocationTop3);
				}
				if (intMxCallLocationTop6mList != null && intMxCallLocationTop6mList.size() > 0) {
					callLocationTop3Mapper.insertSelective(intMxCallLocationTop6mList);
				}
				intMxCallLocationTop6mList.clear();
				intMxCallLocationTop6mList = null;
			}
		}

		// 03风险分析-风险分析 int_mx_risk_analyse
		IntMxRiskAnalysis riskAnalyse = new IntMxRiskAnalysis();
		riskAnalyse.setSerialNum(tokenId);
		riskAnalyse.setLoanId(loanId);
		try {
			if (null != numberReport.getFriendCircle()) {
				if (null != numberReport.getFriendCircle().getRiskAnalysis()) {
					riskAnalyse.setInTime(numberReport.getFriendCircle().getRiskAnalysis().getInTime());
					riskAnalyse.setBindingRisk(numberReport.getFriendCircle().getRiskAnalysis().getBindingRisk());
					riskAnalyse.setMobileSilence3m(
							numberReport.getFriendCircle().getRiskAnalysis().getMobileSilence3m());
					riskAnalyse.setMobileSilence6m(
							numberReport.getFriendCircle().getRiskAnalysis().getMobileSilence6m());
					riskAnalyse.setArrearageRisk3m(
							numberReport.getFriendCircle().getRiskAnalysis().getArrearageRisk3m());
					riskAnalyse.setArrearageRisk6m(
							numberReport.getFriendCircle().getRiskAnalysis().getArrearageRisk6m());
					riskAnalyse.setGmtCreate(Calendar.getInstance().getTime());
					riskAnalysisMapper.insertSelective(riskAnalyse);

					// 03风险分析-关联风险项 int_mx_risk_check_item

					if (null != numberReport.getFriendCircle().getRiskAnalysis().getRiskCheckItem()
							&& numberReport.getFriendCircle().getRiskAnalysis().getRiskCheckItem().isEmpty()) {
						List<IntMxRiskCheckItem> intMxRiskCheckItemList = new ArrayList<IntMxRiskCheckItem>();
						for (int i = 0; i < numberReport.getFriendCircle().getRiskAnalysis().getRiskCheckItem()
								.size(); i++) {
							IntMxRiskCheckItem riskCheck = new IntMxRiskCheckItem();
							riskCheck.setSerialNum(tokenId);
							riskCheck.setLoanId(loanId);
							riskCheck.setItem(numberReport.getFriendCircle().getRiskAnalysis().getRiskCheckItem()
									.get(i).getItem());
							riskCheck.setCallNum3m(numberReport.getFriendCircle().getRiskAnalysis()
									.getRiskCheckItem().get(i).getCallNum3m());
							riskCheck.setCallNum6m(numberReport.getFriendCircle().getRiskAnalysis()
									.getRiskCheckItem().get(i).getCallNum6m());
							riskCheck.setCallTime3m(numberReport.getFriendCircle().getRiskAnalysis()
									.getRiskCheckItem().get(i).getCallTime3m());
							riskCheck.setCallTime6m(numberReport.getFriendCircle().getRiskAnalysis()
									.getRiskCheckItem().get(i).getCallTime6m());
							riskCheck.setGmtCreate(Calendar.getInstance().getTime());
							intMxRiskCheckItemList.add(riskCheck);

						}
						if (intMxRiskCheckItemList != null && intMxRiskCheckItemList.size() > 0) {
							riskCheckMapper.insertSelective(intMxRiskCheckItemList);
						}
						intMxRiskCheckItemList.clear();
						intMxRiskCheckItemList = null;
					}
				}
			}
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("03风险分析-风险分析 int_mx_risk_analyse:" + e);
		}

		// 04活跃度分析-活跃度分析 int_mx_active_degree
		IntMxActiveDegress activeDegress = new IntMxActiveDegress();
		activeDegress.setSerialNum(tokenId);
		activeDegress.setLoanId(loanId);
		try {
			if (null != numberReport.getFriendCircle()) {
				if (null != numberReport.getFriendCircle().getActiveDegree()) {
					activeDegress.setCallDay3m(numberReport.getFriendCircle().getActiveDegree().getCallDay3m());
					activeDegress.setCallDay6m(numberReport.getFriendCircle().getActiveDegree().getCallDay6m());
					activeDegress.setDialNum3m(numberReport.getFriendCircle().getActiveDegree().getDialNum3m());
					activeDegress.setDialNum6m(numberReport.getFriendCircle().getActiveDegree().getDialNum6m());
					activeDegress.setDialedNum3m(numberReport.getFriendCircle().getActiveDegree().getDialedNum3m());
					activeDegress.setDialedNum6m(numberReport.getFriendCircle().getActiveDegree().getDialedNum6m());
					activeDegress.setDialDuration3m(
							numberReport.getFriendCircle().getActiveDegree().getDialDuration3m());
					activeDegress.setDialDuration6m(
							numberReport.getFriendCircle().getActiveDegree().getDialDuration6m());
					activeDegress.setDialedDuration3m(
							numberReport.getFriendCircle().getActiveDegree().getDialedDuration3m());
					activeDegress.setDialedDuration6m(
							numberReport.getFriendCircle().getActiveDegree().getDialedDuration6m());
					activeDegress.setGmtCreate(Calendar.getInstance().getTime());
					activeDegressMapper.insertSelective(activeDegress);
				}

			}

		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("04活跃度分析-活跃度分析 int_mx_active_degree:" + e);
		}

		// 05消费分析-消费分析 int_mx_consumption_analysis
		IntMxConsumptionAnalysis consumpAnalyse = new IntMxConsumptionAnalysis();
		consumpAnalyse.setSerialNum(tokenId);
		consumpAnalyse.setLoanId(loanId);
		try {
			if (null != numberReport.getFriendCircle()) {
				if (null != numberReport.getFriendCircle().getConsumptionAnalysis()) {
					consumpAnalyse
							.setTotalFee3m(numberReport.getFriendCircle().getConsumptionAnalysis().getTotalFee3m());
					consumpAnalyse
							.setTotalFee6m(numberReport.getFriendCircle().getConsumptionAnalysis().getTotalFee6m());
					consumpAnalyse.setRechargeTime3m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getRechargeTime3m());
					consumpAnalyse.setRechargeTime6m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getRechargeTime6m());
					consumpAnalyse.setRechargeMaxAmount3m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getRechargeMaxAmount3m());
					consumpAnalyse.setRechargeMaxAmount6m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getRechargeMaxAmount6m());
					consumpAnalyse
							.setWebFee1m(numberReport.getFriendCircle().getConsumptionAnalysis().getWebFee1m());
					consumpAnalyse
							.setWebFee3m(numberReport.getFriendCircle().getConsumptionAnalysis().getWebFee3m());
					consumpAnalyse
							.setWebFee6m(numberReport.getFriendCircle().getConsumptionAnalysis().getWebFee6m());
					consumpAnalyse.setWebFeeAvg3m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getWebFeeAvg3m());
					consumpAnalyse.setWebFeeAvg6m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getWebFeeAvg6m());
					consumpAnalyse
							.setSmsFee1m(numberReport.getFriendCircle().getConsumptionAnalysis().getSmsFee1m());
					consumpAnalyse
							.setSmsFee3m(numberReport.getFriendCircle().getConsumptionAnalysis().getSmsFee3m());
					consumpAnalyse
							.setSmsFee6m(numberReport.getFriendCircle().getConsumptionAnalysis().getSmsFee6m());
					consumpAnalyse.setSmsFeeAvg3m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getSmsFeeAvg3m());
					consumpAnalyse.setSmsFeeAvg6m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getSmsFeeAvg6m());
					consumpAnalyse
							.setCallFee1m(numberReport.getFriendCircle().getConsumptionAnalysis().getCallFee1m());
					consumpAnalyse
							.setCallFee3m(numberReport.getFriendCircle().getConsumptionAnalysis().getCallFee3m());
					consumpAnalyse
							.setCallFee6m(numberReport.getFriendCircle().getConsumptionAnalysis().getCallFee6m());
					consumpAnalyse.setCallFeeAvg3m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getCallFeeAvg3m());
					consumpAnalyse.setCallFeeAvg6m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getCallFeeAvg6m());
					consumpAnalyse
							.setVasFee1m(numberReport.getFriendCircle().getConsumptionAnalysis().getVasFee1m());
					consumpAnalyse
							.setVasFee3m(numberReport.getFriendCircle().getConsumptionAnalysis().getVasFee3m());
					consumpAnalyse
							.setVasFee6m(numberReport.getFriendCircle().getConsumptionAnalysis().getVasFee6m());
					consumpAnalyse.setVasFeeAvg3m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getVasFeeAvg3m());
					consumpAnalyse.setVasFeeAvg6m(
							numberReport.getFriendCircle().getConsumptionAnalysis().getVasFeeAvg6m());
					consumpAnalyse.setGmtCreate(Calendar.getInstance().getTime());
					consumpAnalyseMapper.insertSelective(consumpAnalyse);
				}
			}
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("05消费分析-消费分析 int_mx_consumption_analysis:" + e);
		}

		// 06通话整体统计-通话整体统计 int_mx_call_analysis
		IntMxCallAnalysis callAnalyse = new IntMxCallAnalysis();
		callAnalyse.setSerialNum(tokenId);
		callAnalyse.setLoanId(loanId);
		try {
			if (null != numberReport.getFriendCircle()) {
				if (null != numberReport.getFriendCircle().getCallAnalysis()) {
					callAnalyse.setTotalNum1m(numberReport.getFriendCircle().getCallAnalysis().getTotalNum1m());
					callAnalyse.setTotalNum3m(numberReport.getFriendCircle().getCallAnalysis().getTotalNum3m());
					callAnalyse.setTotalNum6m(numberReport.getFriendCircle().getCallAnalysis().getTotalNum6m());
					callAnalyse
							.setTotalNumAvg3m(numberReport.getFriendCircle().getCallAnalysis().getTotalNumAvg3m());
					callAnalyse
							.setTotalNumAvg6m(numberReport.getFriendCircle().getCallAnalysis().getTotalNumAvg6m());

					callAnalyse.setTotalTime1m(numberReport.getFriendCircle().getCallAnalysis().getTotalTime1m());
					callAnalyse.setTotalTime3m(numberReport.getFriendCircle().getCallAnalysis().getTotalTime3m());
					callAnalyse.setTotalTime6m(numberReport.getFriendCircle().getCallAnalysis().getTotalTime6m());
					callAnalyse.setTotalTimeAvg3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalTimeAvg3m());
					callAnalyse.setTotalTimeAvg6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalTimeAvg6m());

					callAnalyse.setTotalPeerNum1m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalPeerNum1m());
					callAnalyse.setTotalPeerNum3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalPeerNum3m());
					callAnalyse.setTotalPeerNum6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalPeerNum6m());
					callAnalyse.setTotalPeerNumAvg3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalPeerNumAvg3m());
					callAnalyse.setTotalPeerNumAvg6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalPeerNumAvg6m());

					callAnalyse.setTotalCityNum1m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalCityNum1m());
					callAnalyse.setTotalCityNum3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalCityNum3m());
					callAnalyse.setTotalCityNum6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalCityNum6m());
					callAnalyse.setTotalCityNumAvg3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalCityNumAvg3m());
					callAnalyse.setTotalCityNumAvg6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalCityNumAvg6m());

					callAnalyse.setTotalDialNum1m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialNum1m());
					callAnalyse.setTotalDialNum3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialNum3m());
					callAnalyse.setTotalDialNum6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialNum6m());
					callAnalyse.setTotalDialNumAvg3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialNumAvg3m());
					callAnalyse.setTotalDialNumAvg6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialNumAvg6m());

					callAnalyse
							.setTotalDialedNum1m(numberReport.getFriendCircle().getCallAnalysis().getTotalDialedNum1m());
					callAnalyse
							.setTotalDialedNum3m(numberReport.getFriendCircle().getCallAnalysis().getTotalDialedNum3m());
					callAnalyse
							.setTotalDialedNum6m(numberReport.getFriendCircle().getCallAnalysis().getTotalDialedNum6m());
					callAnalyse.setTotalDialedNumAvg3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialedNumAvg3m());
					callAnalyse.setTotalDialedNumAvg6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialedNumAvg6m());

					callAnalyse.setTotalDialPeerNum1m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialPeerNum1m());
					callAnalyse.setTotalDialPeerNum3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialPeerNum3m());
					callAnalyse.setTotalDialPeerNum6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialPeerNum6m());
					callAnalyse.setTotalDialPeerNumAvg3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialPeerNumAvg3m());
					callAnalyse.setTotalDialPeerNumAvg6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialPeerNumAvg6m());

					callAnalyse.setTotalDialedPeerNum1m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialedPeerNum1m());
					callAnalyse.setTotalDialedPeerNum3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialedPeerNum3m());
					callAnalyse.setTotalDialedPeerNum6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialedPeerNum6m());
					callAnalyse.setTotalDialedPeerNumAvg3m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialedPeerNumAvg3m());
					callAnalyse.setTotalDialedPeerNumAvg6m(
							numberReport.getFriendCircle().getCallAnalysis().getTotalDialedPeerNumAvg6m());

					callAnalyse.setGmtCreate(Calendar.getInstance().getTime());
					callAnalyseMapper.insertSelective(callAnalyse);
				}
			}
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("06通话整体统计-通话整体统计 int_mx_call_analysis:" + e);
		}

		// 07通话详情分析-通话详情分析 int_mx_call_contact_detail
		try {
			if (null != numberReport.getFriendCircle()
					&& !numberReport.getFriendCircle().getCallContactDetail().isEmpty()) {
				List<IntMxCallContactDetail> intMxCallContactDetailList = new ArrayList<IntMxCallContactDetail>();
				for (int i = 0; i < numberReport.getFriendCircle().getCallContactDetail().size(); i++) {
					IntMxCallContactDetail callContDetail = new IntMxCallContactDetail();
					callContDetail.setSerialNum(tokenId);
					callContDetail.setLoanId(loanId);
					callContDetail
							.setPeerNum(numberReport.getFriendCircle().getCallContactDetail().get(i).getPeerNum());
					callContDetail.setCity(numberReport.getFriendCircle().getCallContactDetail().get(i).getCity());
					callContDetail.setCallNum1w(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNum1w());
					callContDetail.setCallNum1m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNum1m());
					callContDetail.setCallNum3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNum3m());
					callContDetail.setCallNum6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNum6m());
					callContDetail.setCallTime3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallTime3m());
					callContDetail.setCallTime6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallTime6m());
					callContDetail.setDialNum3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getDialNum3m());
					callContDetail.setDialNum6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getDialNum6m());
					callContDetail.setDialedNum3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getDialedNum3m());
					callContDetail.setDialedNum6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getDialedNum6m());
					callContDetail.setCallNumMorning3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumMorning3m());
					callContDetail.setCallNumMorning6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumMorning6m());
					callContDetail.setCallNumNoon3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumNoon3m());
					callContDetail.setCallNumNoon6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumNoon6m());
					callContDetail.setCallNumAfternoon3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumAfternoon3m());
					callContDetail.setCallNumAfternoon6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumAfternoon6m());
					callContDetail.setCallNumEvening3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumAfternoon3m());
					callContDetail.setCallNumEvening6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumAfternoon6m());
					callContDetail.setCallNumNight3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumEvening3m());
					callContDetail.setCallNumNight6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumEvening6m());
					callContDetail.setCallNumWeekday3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumWeekday3m());
					callContDetail.setCallNumWeekday6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumWeekday6m());
					callContDetail.setCallNumWeekend3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumWeekend3m());
					callContDetail.setCallNumWeekend6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumWeekend6m());
					callContDetail.setCallNumHoliday3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumHoliday3m());
					callContDetail.setCallNumHoliday6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallNumHoliday6m());
					callContDetail.setCallIfWholeDay3m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallIfWholeDay3m());
					callContDetail.setCallIfWholeDay6m(
							numberReport.getFriendCircle().getCallContactDetail().get(i).getCallIfWholeDay6m());
					callContDetail.setGmtCreate(Calendar.getInstance().getTime());
					intMxCallContactDetailList.add(callContDetail);
				}
				if (intMxCallContactDetailList != null && intMxCallContactDetailList.size() > 0) {
					callContDetailMapper.insertSelective(intMxCallContactDetailList);
				}
				intMxCallContactDetailList.clear();
				intMxCallContactDetailList = null;

			}
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error(">>>>>>>>通话详情分析-通话详情分析 int_mx_call_contact_detail:" + e);
		}

		// 08通话时段分析-通话时段分析 int_mx_call_duration_detial
		try {
			if (null != numberReport.getFriendCircle()) {
				if (null != numberReport.getFriendCircle().getCallDurationDetail3m()
						&& !numberReport.getFriendCircle().getCallDurationDetail3m().isEmpty()) {
					List<IntMxCallDurationDetail> intMxCallDurationDetailList = new ArrayList<IntMxCallDurationDetail>();
					for (int i = 0; i < numberReport.getFriendCircle().getCallDurationDetail3m().size(); i++) {
						IntMxCallDurationDetail callDuraDetail = new IntMxCallDurationDetail();
						callDuraDetail.setSerialNum(tokenId);
						callDuraDetail.setLoanId(loanId);
						callDuraDetail.setOrderNum(i + 1);
						callDuraDetail.setTimeStep(
								numberReport.getFriendCircle().getCallDurationDetail3m().get(i).getTimeStep());
						callDuraDetail.setTotalNum(
								numberReport.getFriendCircle().getCallDurationDetail3m().get(i).getTotalNum());
						callDuraDetail.setPeerNum(
								numberReport.getFriendCircle().getCallDurationDetail3m().get(i).getPeerNum());
						callDuraDetail.setTotalTime(
								numberReport.getFriendCircle().getCallDurationDetail3m().get(i).getTotalTime());
						callDuraDetail.setDialNum(
								numberReport.getFriendCircle().getCallDurationDetail3m().get(i).getDialNum());
						callDuraDetail.setDialedNum(
								numberReport.getFriendCircle().getCallDurationDetail3m().get(i).getDialedNum());
						callDuraDetail.setLatestCallTime(numberReport.getFriendCircle().getCallDurationDetail3m()
								.get(i).getLatestCallTime());
						callDuraDetail.setFarthestCallTime(numberReport.getFriendCircle().getCallDurationDetail3m()
								.get(i).getFarthestCallTime());
						callDuraDetail.setDataType("近三个月");
						callDuraDetail.setGmtCreate(Calendar.getInstance().getTime());
						intMxCallDurationDetailList.add(callDuraDetail);
					}
					if (intMxCallDurationDetailList != null && intMxCallDurationDetailList.size() > 0) {
						callDuraDetailMapper.insertSelective(intMxCallDurationDetailList);
					}
					intMxCallDurationDetailList.clear();
					intMxCallDurationDetailList = null;
				}
			}
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("08通话时段分析-通话时段分析 int_mx_call_duration_detial:" + e);
		}

		if (null != numberReport.getFriendCircle()) {
			if (null != numberReport.getFriendCircle().getCallDurationDetail6m()
					&& !numberReport.getFriendCircle().getCallDurationDetail6m().isEmpty()) {
				List<IntMxCallDurationDetail> intMxCallDurationDetail6mList = new ArrayList<IntMxCallDurationDetail>();
				for (int i = 0; i < numberReport.getFriendCircle().getCallDurationDetail6m().size(); i++) {
					IntMxCallDurationDetail callDuraDetail = new IntMxCallDurationDetail();
					callDuraDetail.setSerialNum(tokenId);
					callDuraDetail.setLoanId(loanId);
					callDuraDetail.setOrderNum(i + 1);
					callDuraDetail.setTimeStep(
							numberReport.getFriendCircle().getCallDurationDetail6m().get(i).getTimeStep());
					callDuraDetail.setTotalNum(
							numberReport.getFriendCircle().getCallDurationDetail6m().get(i).getTotalNum());
					callDuraDetail.setPeerNum(
							numberReport.getFriendCircle().getCallDurationDetail6m().get(i).getPeerNum());
					callDuraDetail.setTotalTime(
							numberReport.getFriendCircle().getCallDurationDetail6m().get(i).getTotalTime());
					callDuraDetail.setDialNum(
							numberReport.getFriendCircle().getCallDurationDetail6m().get(i).getDialNum());
					callDuraDetail.setDialedNum(
							numberReport.getFriendCircle().getCallDurationDetail6m().get(i).getDialedNum());
					callDuraDetail.setLatestCallTime(
							numberReport.getFriendCircle().getCallDurationDetail6m().get(i).getLatestCallTime());
					callDuraDetail.setFarthestCallTime(
							numberReport.getFriendCircle().getCallDurationDetail6m().get(i).getFarthestCallTime());
					callDuraDetail.setDataType("近六个月");
					callDuraDetail.setGmtCreate(Calendar.getInstance().getTime());
					intMxCallDurationDetail6mList.add(callDuraDetail);

				}
				if (intMxCallDurationDetail6mList != null && intMxCallDurationDetail6mList.size() > 0) {
					callDuraDetailMapper.insertSelective(intMxCallDurationDetail6mList);
					intMxCallDurationDetail6mList.clear();
					intMxCallDurationDetail6mList = null;
				}
			}

			// 09通话归属地-通话归属地详情 int_mx_call_location_detail
			try {
				if (null != numberReport.getFriendCircle().getCallLocationDetail3m()
						&& !numberReport.getFriendCircle().getCallLocationDetail3m().isEmpty()) {
					List<IntMxCallLocationDetail> intMxCallLocationDetailList = new ArrayList<IntMxCallLocationDetail>();
					for (int i = 0; i < numberReport.getFriendCircle().getCallLocationDetail3m().size(); i++) {
						IntMxCallLocationDetail callLocatDetail = new IntMxCallLocationDetail();
						callLocatDetail.setSerialNum(tokenId);
						callLocatDetail.setLoanId(loanId);
						callLocatDetail.setOrderNum(i + 1);
						callLocatDetail
								.setCity(numberReport.getFriendCircle().getCallLocationDetail3m().get(i).getCity());
						callLocatDetail.setTotalNum(
								numberReport.getFriendCircle().getCallLocationDetail3m().get(i).getTotalNum());
						callLocatDetail.setPeerNum(
								numberReport.getFriendCircle().getCallLocationDetail3m().get(i).getPeerNum());
						callLocatDetail.setTotalTime(
								numberReport.getFriendCircle().getCallLocationDetail3m().get(i).getTotalTime());
						callLocatDetail.setDialNum(
								numberReport.getFriendCircle().getCallLocationDetail3m().get(i).getDialNum());
						callLocatDetail.setDialedNum(
								numberReport.getFriendCircle().getCallLocationDetail3m().get(i).getDialedNum());
						callLocatDetail.setDialTime(
								numberReport.getFriendCircle().getCallLocationDetail3m().get(i).getDialTime());
						callLocatDetail.setDialedTime(
								numberReport.getFriendCircle().getCallLocationDetail3m().get(i).getDialedTime());
						callLocatDetail.setDialTimeAvg(
								numberReport.getFriendCircle().getCallLocationDetail3m().get(i).getDialTimeAvg());
						callLocatDetail.setDialedTimeAvg(
								numberReport.getFriendCircle().getCallLocationDetail3m().get(i).getDialedTimeAvg());
						callLocatDetail.setDialNumPercent(numberReport.getFriendCircle().getCallLocationDetail3m()
								.get(i).getDialNumPercent());
						callLocatDetail.setDialedNumPercent(numberReport.getFriendCircle().getCallLocationDetail3m()
								.get(i).getDialedNumPercent());
						callLocatDetail.setDialTimePercent(numberReport.getFriendCircle().getCallLocationDetail3m()
								.get(i).getDialTimePrecent());
						callLocatDetail.setDialedTimePercent(numberReport.getFriendCircle()
								.getCallLocationDetail3m().get(i).getDialedTimePrecent());
						callLocatDetail.setGmtCreate(Calendar.getInstance().getTime());
						callLocatDetail.setDataType("近三个月");
						intMxCallLocationDetailList.add(callLocatDetail);

					}
					if (intMxCallLocationDetailList != null && intMxCallLocationDetailList.size() > 0) {
						callLocatDetailMapper.insertSelective(intMxCallLocationDetailList);
					}
					intMxCallLocationDetailList.clear();
					intMxCallLocationDetailList = null;
				}

			} catch (Exception e) {
				MarvelsLogUtil.getInstance().error("09通话归属地-通话归属地详情异常 int_mx_call_third_party_detail", e);
			}

			if (null != numberReport.getFriendCircle().getCallLocationDetail6m()
					&& !numberReport.getFriendCircle().getCallLocationDetail6m().isEmpty()) {
				List<IntMxCallLocationDetail> intMxCallLocationDetail6mList = new ArrayList<IntMxCallLocationDetail>();
				for (int i = 0; i < numberReport.getFriendCircle().getCallLocationDetail6m().size(); i++) {
					IntMxCallLocationDetail callLocatDetail = new IntMxCallLocationDetail();
					callLocatDetail.setSerialNum(tokenId);
					callLocatDetail.setLoanId(loanId);
					callLocatDetail.setOrderNum(i + 1);
					callLocatDetail
							.setCity(numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getCity());
					callLocatDetail.setTotalNum(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getTotalNum());
					callLocatDetail.setPeerNum(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getPeerNum());
					callLocatDetail.setTotalTime(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getTotalTime());
					callLocatDetail.setDialNum(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getDialNum());
					callLocatDetail.setDialedNum(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getDialedNum());
					callLocatDetail.setDialTime(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getDialTime());
					callLocatDetail.setDialedTime(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getDialedTime());
					callLocatDetail.setDialTimeAvg(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getDialTimeAvg());
					callLocatDetail.setDialedTimeAvg(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getDialedTimeAvg());
					callLocatDetail.setDialNumPercent(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getDialNumPercent());
					callLocatDetail.setDialedNumPercent(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getDialedNumPercent());
					callLocatDetail.setDialTimePercent(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getDialTimePrecent());
					callLocatDetail.setDialedTimePercent(
							numberReport.getFriendCircle().getCallLocationDetail6m().get(i).getDialedTimePrecent());
					callLocatDetail.setGmtCreate(Calendar.getInstance().getTime());
					callLocatDetail.setDataType("近六个月");
					intMxCallLocationDetail6mList.add(callLocatDetail);
				}
				if (intMxCallLocationDetail6mList != null && intMxCallLocationDetail6mList.size() > 0) {
					callLocatDetailMapper.insertSelective(intMxCallLocationDetail6mList);
				}
				intMxCallLocationDetail6mList.clear();
				intMxCallLocationDetail6mList = null;
			}

			// 10通话时间分析-通话时间分析 int_mx_call_time_detail
			IntMxCallTimeDetail callTimeDetail = new IntMxCallTimeDetail();
			callTimeDetail.setSerialNum(tokenId);
			callTimeDetail.setLoanId(loanId);
			if (null != numberReport.getFriendCircle().getCallTimeDetail()) {
				callTimeDetail.setMaxTime1m(numberReport.getFriendCircle().getCallTimeDetail().getMaxTime1m());
				callTimeDetail.setMaxTime3m(numberReport.getFriendCircle().getCallTimeDetail().getMaxTime3m());
				callTimeDetail.setMaxTime6m(numberReport.getFriendCircle().getCallTimeDetail().getMaxTime6m());

				callTimeDetail.setMinTime1m(numberReport.getFriendCircle().getCallTimeDetail().getMinTime1m());
				callTimeDetail.setMinTime3m(numberReport.getFriendCircle().getCallTimeDetail().getMinTime3m());
				callTimeDetail.setMinTime6m(numberReport.getFriendCircle().getCallTimeDetail().getMinTime6m());

				callTimeDetail.setCallTimeIn1Min1m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn1Min1m());
				callTimeDetail.setCallTimeIn1Min3m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn1Min3m());
				callTimeDetail.setCallTimeIn1Min6m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn1Min6m());
				callTimeDetail.setCallTimeIn1MinAvg3m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn1MinAvg3m());
				callTimeDetail.setCallTimeIn1MinAvg6m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn1MinAvg6m());

				callTimeDetail.setCallTimeIn5Min1m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn5Min1m());
				callTimeDetail.setCallTimeIn5Min3m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn5Min3m());
				callTimeDetail.setCallTimeIn5Min6m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn5Min6m());
				callTimeDetail.setCallTimeIn5MinAvg3m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn5MinAvg3m());
				callTimeDetail.setCallTimeIn5MinAvg6m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn5MinAvg6m());

				callTimeDetail.setCallTimeIn10Min1m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn10Min1m());
				callTimeDetail.setCallTimeIn10Min3m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn10Min3m());
				callTimeDetail.setCallTimeIn10Min6m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn10Min6m());
				callTimeDetail.setCallTimeIn10MinAvg3m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn10MinAvg3m());
				callTimeDetail.setCallTimeIn10MinAvg6m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeIn10MinAvg6m());

				callTimeDetail.setCallTimeOver10Min1m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeOver10Min1m());
				callTimeDetail.setCallTimeOver10Min3m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeOver10Min3m());
				callTimeDetail.setCallTimeOver10Min6m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeOver10Min6m());
				callTimeDetail.setCallTimeOver10MinAvg3m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeOver10MinAvg3m());
				callTimeDetail.setCallTimeOver10MinAvg6m(
						numberReport.getFriendCircle().getCallTimeDetail().getCallTimeOver10MinAvg6m());

				callTimeDetail.setInDayTime1m(numberReport.getFriendCircle().getCallTimeDetail().getInDayTime1m());
				callTimeDetail.setInDayTime3m(numberReport.getFriendCircle().getCallTimeDetail().getInDayTime3m());
				callTimeDetail.setInDayTime6m(numberReport.getFriendCircle().getCallTimeDetail().getInDayTime6m());
				callTimeDetail
						.setInDayTimeAvg3m(numberReport.getFriendCircle().getCallTimeDetail().getInDayTimeAvg3m());
				callTimeDetail
						.setInDayTimeAvg6m(numberReport.getFriendCircle().getCallTimeDetail().getInDayTimeAvg6m());

				callTimeDetail
						.setInNightTime1m(numberReport.getFriendCircle().getCallTimeDetail().getInNightTime1m());
				callTimeDetail
						.setInNightTime3m(numberReport.getFriendCircle().getCallTimeDetail().getInNightTime3m());
				callTimeDetail
						.setInNightTime6m(numberReport.getFriendCircle().getCallTimeDetail().getInNightTime6m());
				callTimeDetail.setInNightTimeAvg3m(
						numberReport.getFriendCircle().getCallTimeDetail().getInNightTimeAvg3m());
				callTimeDetail.setInNightTimeAvg6m(
						numberReport.getFriendCircle().getCallTimeDetail().getInNightTimeAvg6m());

				callTimeDetail.setInDayNum1m(numberReport.getFriendCircle().getCallTimeDetail().getInDayNum1m());
				callTimeDetail.setInDayNum3m(numberReport.getFriendCircle().getCallTimeDetail().getInDayNum3m());
				callTimeDetail.setInDayNum6m(numberReport.getFriendCircle().getCallTimeDetail().getInDayNum6m());
				callTimeDetail
						.setInDayNumAvg3m(numberReport.getFriendCircle().getCallTimeDetail().getInDayNumAvg3m());
				callTimeDetail
						.setInDayNumAvg6m(numberReport.getFriendCircle().getCallTimeDetail().getInDayNumAvg6m());

				callTimeDetail
						.setInNightNum1m(numberReport.getFriendCircle().getCallTimeDetail().getInNightNum1m());
				callTimeDetail
						.setInNightNum3m(numberReport.getFriendCircle().getCallTimeDetail().getInNightNum3m());
				callTimeDetail
						.setInNightNum6m(numberReport.getFriendCircle().getCallTimeDetail().getInNightNum6m());
				callTimeDetail.setInNightNumAvg3m(
						numberReport.getFriendCircle().getCallTimeDetail().getInNightNumAvg3m());
				callTimeDetail.setInNightNumAvg6m(
						numberReport.getFriendCircle().getCallTimeDetail().getInNightNumAvg6m());

				callTimeDetail.setLocalNum1m(numberReport.getFriendCircle().getCallTimeDetail().getLocalNum1m());
				callTimeDetail.setLocalNum3m(numberReport.getFriendCircle().getCallTimeDetail().getLocalNum3m());
				callTimeDetail.setLocalNum6m(numberReport.getFriendCircle().getCallTimeDetail().getLocalNum6m());
				callTimeDetail
						.setLocalNumAvg3m(numberReport.getFriendCircle().getCallTimeDetail().getLocalNumAvg3m());
				callTimeDetail
						.setLocalNumAvg6m(numberReport.getFriendCircle().getCallTimeDetail().getLocalNumAvg6m());

				callTimeDetail.setRemoteNum1m(numberReport.getFriendCircle().getCallTimeDetail().getRemoteNum1m());
				callTimeDetail.setRemoteNum3m(numberReport.getFriendCircle().getCallTimeDetail().getRemoteNum3m());
				callTimeDetail.setRemoteNum6m(numberReport.getFriendCircle().getCallTimeDetail().getRemoteNum6m());
				callTimeDetail
						.setRemoteNumAvg3m(numberReport.getFriendCircle().getCallTimeDetail().getRemoteNumAvg3m());
				callTimeDetail
						.setRemoteNumAvg6m(numberReport.getFriendCircle().getCallTimeDetail().getRemoteNumAvg6m());
			}
			if (null != numberReport.getFriendCircle().getCallTimeDetail()) {
				callTimeDetail.setLocalTime1m(numberReport.getFriendCircle().getCallTimeDetail().getLocalTime1m());
				callTimeDetail.setLocalTime3m(numberReport.getFriendCircle().getCallTimeDetail().getLocalTime3m());
				callTimeDetail.setLocalTime6m(numberReport.getFriendCircle().getCallTimeDetail().getLocalTime6m());
				callTimeDetail
						.setLocalTimeAvg3m(numberReport.getFriendCircle().getCallTimeDetail().getLocalTimeAvg3m());
				callTimeDetail
						.setLocalTimeAvg6m(numberReport.getFriendCircle().getCallTimeDetail().getLocalTimeAvg6m());
			}
			if (null != numberReport.getFriendCircle().getCallTimeDetail()) {
				callTimeDetail
						.setRemoteTime1m(numberReport.getFriendCircle().getCallTimeDetail().getRemoteTime1m());
				callTimeDetail
						.setRemoteTime3m(numberReport.getFriendCircle().getCallTimeDetail().getRemoteTime3m());
				callTimeDetail
						.setRemoteTime6m(numberReport.getFriendCircle().getCallTimeDetail().getRemoteTime6m());
				callTimeDetail.setRemoteTimeAvg3m(
						numberReport.getFriendCircle().getCallTimeDetail().getRemoteTimeAvg3m());
				callTimeDetail.setRemoteTimeAvg6m(
						numberReport.getFriendCircle().getCallTimeDetail().getRemoteTimeAvg6m());
			}
			callTimeDetail.setGmtCreate(Calendar.getInstance().getTime());
			callTimeDetailMapper.insertSelective(callTimeDetail);
		}
		// 11第三方通话分析 int_mx_call_third_party_detail
		IntMxCallThirdPartyDetail callThirdDetail = new IntMxCallThirdPartyDetail();
		callThirdDetail.setSerialNum(tokenId);
		callThirdDetail.setLoanId(loanId);
		try {
			if (null != numberReport.getFriendCircle()) {
				if (null != numberReport.getFriendCircle().getCallThirdPartyDetail()) {
					callThirdDetail.setCall110Num1m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCall110Num1m());
					callThirdDetail.setCall110Num3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCall110Num3m());
					callThirdDetail.setCall110Num6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCall110Num6m());
					callThirdDetail.setCall110NumAvg3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCall110NumAvg3m());
					callThirdDetail.setCall110NumAvg6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCall110NumAvg6m());

					callThirdDetail.setCall110Time1m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCall110Time1m());
					callThirdDetail.setCall110Time3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCall110Time3m());
					callThirdDetail.setCall110Time6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCall110Time6m());
					callThirdDetail.setCall110TimeAvg3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCall110TimeAvg3m());
					callThirdDetail.setCallCollectionFirmTimeAvg6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCall110TimeAvg6m());

					callThirdDetail.setCallLoanNum1m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallLoanNum1m());
					callThirdDetail.setCallLoanNum3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallLoanNum3m());
					callThirdDetail.setCallLoanNum6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallLoanNum6m());
					callThirdDetail.setCallLoanNumAvg3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallLoanNumAvg3m());
					callThirdDetail.setCallLoanNumAvg6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallLoanNumAvg6m());

					callThirdDetail.setCallLoanTime1m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallLoanTime1m());
					callThirdDetail.setCallLoanTime3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallLoanTime3m());
					callThirdDetail.setCallLoanTime6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallLoanTime6m());
					callThirdDetail.setCallLoanTimeAvg3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallLoanTimeAvg3m());
					callThirdDetail.setCallLoanTimeAvg6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallLoanTimeAvg6m());

					callThirdDetail.setCallCreditCardNum1m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCreditCardNum1m());
					callThirdDetail.setCallCreditCardNum3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCreditCardNum3m());
					callThirdDetail.setCallCreditCardNum6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCreditCardNum6m());
					callThirdDetail.setCallCreditCardNumAvg3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCreditCardNumAvg3m());
					callThirdDetail.setCallCreditCardNumAvg6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCreditCardNumAvg6m());

					callThirdDetail.setCallCreditCardTime1m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCreditCardTime1m());
					callThirdDetail.setCallCreditCardTime3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCreditCardTime3m());
					callThirdDetail.setCallCreditCardTime6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCreditCardTime6m());
					callThirdDetail.setCallCreditCardTimeAvg3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCreditCardTimeAvg3m());
					callThirdDetail.setCallCreditCardTimeAvg6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCreditCardTimeAvg6m());

					callThirdDetail.setCallMaconNum1m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallMaconNum1m());
					callThirdDetail.setCallMaconNum3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallMaconNum3m());
					callThirdDetail.setCallMaconNum6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallMaconNum6m());
					callThirdDetail.setCallMaconNumAvg3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallMaconNumAvg3m());
					callThirdDetail.setCallMaconNumAvg6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallMaconNumAvg6m());

					callThirdDetail.setCallMaconTime1m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallMaconTime1m());
					callThirdDetail.setCallMaconTime3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallMaconTime3m());
					callThirdDetail.setCallMaconTime6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallMaconTime6m());
					callThirdDetail.setCallMaconTimeAvg3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallMaconTimeAvg3m());
					callThirdDetail.setCallMaconTimeAvg6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallMaconTimeAvg6m());

					callThirdDetail.setCallCollectionFirmNum1m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCollectionFirmNum1m());
					callThirdDetail.setCallCollectionFirmNum3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCollectionFirmNum3m());
					callThirdDetail.setCallCollectionFirmNum6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCollectionFirmNum6m());
					callThirdDetail.setCallCollectionFirmNumAvg3m(numberReport.getFriendCircle()
							.getCallThirdPartyDetail().getCallCollectionFirmNumAvg3m());
					callThirdDetail.setCallCollectionFirmNumAvg6m(numberReport.getFriendCircle()
							.getCallThirdPartyDetail().getCallCollectionFirmNumAvg6m());

					callThirdDetail.setCallCollectionFirmTime1m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCollectionFirmTime1m());
					callThirdDetail.setCallCollectionFirmTime3m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCollectionFirmTime3m());
					callThirdDetail.setCallCollectionFirmTime6m(
							numberReport.getFriendCircle().getCallThirdPartyDetail().getCallCollectionFirmTime6m());
					callThirdDetail.setCallCollectionFirmTimeAvg3m(numberReport.getFriendCircle()
							.getCallThirdPartyDetail().getCallCollectionFirmTimeAvg3m());
					callThirdDetail.setCallCollectionFirmTimeAvg6m(numberReport.getFriendCircle()
							.getCallThirdPartyDetail().getCallCollectionFirmTimeAvg6m());
				}
			}
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("11第三方通话分析 int_mx_call_third_party_detail:" + e);
		}

		callThirdDetail.setGmtCreate(Calendar.getInstance().getTime());
		callThirdDetailMapper.insertSelective(callThirdDetail);

		// 12亲情网通话分析 int_mx_call_family_detail
		IntMxCallFamilyDetail callFamilyDetail = new IntMxCallFamilyDetail();
		callFamilyDetail.setSerialNum(tokenId);
		callFamilyDetail.setLoanId(loanId);

		try {
			if (null != numberReport.getFriendCircle()) {
				if (null != numberReport.getFriendCircle().getCallFamilyDetail()) {
					callFamilyDetail.setIsFamilyNetMember1m(
							numberReport.getFriendCircle().getCallFamilyDetail().getIsFamilyNetMember1m());
					callFamilyDetail.setIsFamilyNetMember3m(
							numberReport.getFriendCircle().getCallFamilyDetail().getIsFamilyNetMember3m());
					callFamilyDetail.setIsFamilyNetMember6m(
							numberReport.getFriendCircle().getCallFamilyDetail().getIsFamilyNetMember6m());

					callFamilyDetail.setIsFamilyNetMaster1m(
							numberReport.getFriendCircle().getCallFamilyDetail().getIsFamilyNetMaster1m());
					callFamilyDetail.setIsFamilyNetMaster3m(
							numberReport.getFriendCircle().getCallFamilyDetail().getIsFamilyNetMaster3m());
					callFamilyDetail.setIsFamilyNetMaster6m(
							numberReport.getFriendCircle().getCallFamilyDetail().getIsFamilyNetMaster6m());

					callFamilyDetail.setRechargeMonth1m(
							numberReport.getFriendCircle().getCallFamilyDetail().getRechargeMonth1m());
					callFamilyDetail.setRechargeMonth3m(
							numberReport.getFriendCircle().getCallFamilyDetail().getRechargeMonth3m());
					callFamilyDetail.setRechargeMonth6m(
							numberReport.getFriendCircle().getCallFamilyDetail().getRechargeMonth6m());

					callFamilyDetail.setIsAddressMatchPhone1m(
							numberReport.getFriendCircle().getCallFamilyDetail().getIsAddressMatchPhone1m());
					callFamilyDetail.setIsAddressMatchPhone3m(
							numberReport.getFriendCircle().getCallFamilyDetail().getIsAddressMatchPhone3m());
					callFamilyDetail.setIsAddressMatchPhone6m(
							numberReport.getFriendCircle().getCallFamilyDetail().getIsAddressMatchPhone6m());

					callFamilyDetail.setNumOfCallLess1m(
							numberReport.getFriendCircle().getCallFamilyDetail().getNumOfCallLess1m());
					callFamilyDetail.setNumOfCallLess3m(
							numberReport.getFriendCircle().getCallFamilyDetail().getNumOfCallLess3m());
					callFamilyDetail.setNumOfCallLess6m(
							numberReport.getFriendCircle().getCallFamilyDetail().getNumOfCallLess6m());

					callFamilyDetail.setNumOfCallMore1m(
							numberReport.getFriendCircle().getCallFamilyDetail().getNumOfCallMore1m());
					callFamilyDetail.setNumOfCallMore3m(
							numberReport.getFriendCircle().getCallFamilyDetail().getNumOfCallMore3m());
					callFamilyDetail.setNumOfCallMore6m(
							numberReport.getFriendCircle().getCallFamilyDetail().getNumOfCallMore6m());

					callFamilyDetail.setUnpaidMonth1m(
							numberReport.getFriendCircle().getCallFamilyDetail().getUnpaidMonth1m());
					callFamilyDetail.setUnpaidMonth3m(
							numberReport.getFriendCircle().getCallFamilyDetail().getUnpaidMonth3m());
					callFamilyDetail.setUnpaidMonth6m(
							numberReport.getFriendCircle().getCallFamilyDetail().getUnpaidMonth6m());

					callFamilyDetail
							.setLiveMonth1m(numberReport.getFriendCircle().getCallFamilyDetail().getLiveMonth1m());
					callFamilyDetail
							.setLiveMonth3m(numberReport.getFriendCircle().getCallFamilyDetail().getLiveMonth3m());
					callFamilyDetail
							.setLiveMonth6m(numberReport.getFriendCircle().getCallFamilyDetail().getLiveMonth6m());
				}
			}
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("12亲情网通话分析 int_mx_call_family_detail:" + e);
		}

		callFamilyDetail.setGmtCreate(Calendar.getInstance().getTime());
		callFamilyDetailMapper.insertSelective(callFamilyDetail);

		// 13服务号通话详情 int_mx_call_service_detail

		if (null != numberReport.getCallServiceDetail() && !numberReport.getCallServiceDetail().isEmpty()) {
			List<IntMxCallServiceDetail> intMxCallServiceDetailList = new ArrayList<IntMxCallServiceDetail>();
			for (int i = 0; i < numberReport.getCallServiceDetail().size(); i++) {
				IntMxCallServiceDetail callServiceDetail = new IntMxCallServiceDetail();
				callServiceDetail.setSerialNum(tokenId);
				callServiceDetail.setLoanId(loanId);
				callServiceDetail.setServiceNum(numberReport.getCallServiceDetail().get(i).getServiceNum());
				callServiceDetail.setMonths(numberReport.getCallServiceDetail().get(i).getMonths());
				callServiceDetail.setTotalNum(numberReport.getCallServiceDetail().get(i).getTotalNum());
				callServiceDetail.setTotalTime(numberReport.getCallServiceDetail().get(i).getTotalTime());
				callServiceDetail.setDialNum(numberReport.getCallServiceDetail().get(i).getDialNum());
				callServiceDetail.setDialedNum(numberReport.getCallServiceDetail().get(i).getDialedNum());
				callServiceDetail.setDialTime(numberReport.getCallServiceDetail().get(i).getDialTime());
				callServiceDetail.setDialedTime(numberReport.getCallServiceDetail().get(i).getDialedTime());

				callServiceDetail.setGmtCreate(Calendar.getInstance().getTime());
				intMxCallServiceDetailList.add(callServiceDetail);

			}
			if (intMxCallServiceDetailList != null && intMxCallServiceDetailList.size() > 0) {
				callServiceDetailMapper.insertSelective(intMxCallServiceDetailList);
			}
			intMxCallServiceDetailList.clear();
			intMxCallServiceDetailList = null;
		}

		// 14通话活跃度-活跃度分析 int_mx_active_degree_detail
		IntMxActiveDegreeDetail activeDegreeDetail = new IntMxActiveDegreeDetail();
		activeDegreeDetail.setSerialNum(tokenId);
		activeDegreeDetail.setLoanId(loanId);
		if (null != numberReport.getActiveDegreeDetail()) {
			activeDegreeDetail.setCallDay1m(numberReport.getActiveDegreeDetail().getCallDay1m());
			activeDegreeDetail.setCallDay3m(numberReport.getActiveDegreeDetail().getCallDay3m());
			activeDegreeDetail.setCallDay6m(numberReport.getActiveDegreeDetail().getCallDay6m());
			activeDegreeDetail.setCallDayAvg3m(numberReport.getActiveDegreeDetail().getCallDayAvg3m());
			activeDegreeDetail.setCallDayAvg6m(numberReport.getActiveDegreeDetail().getCallDayAvg6m());

			activeDegreeDetail.setSmsDay1m(numberReport.getActiveDegreeDetail().getSmsDay1m());
			activeDegreeDetail.setSmsDay3m(numberReport.getActiveDegreeDetail().getSmsDay3m());
			activeDegreeDetail.setSmsDay6m(numberReport.getActiveDegreeDetail().getSmsDay6m());
			activeDegreeDetail.setSmsDayAvg3m(numberReport.getActiveDegreeDetail().getSmsDayAvg3m());
			activeDegreeDetail.setSmsDayAvg6m(numberReport.getActiveDegreeDetail().getSmsDayAvg6m());

			activeDegreeDetail.setRechargeTime1m(numberReport.getActiveDegreeDetail().getRechargeTime1m());
			activeDegreeDetail.setRechargeTime3m(numberReport.getActiveDegreeDetail().getRechargeTime3m());
			activeDegreeDetail.setRechargeTime6m(numberReport.getActiveDegreeDetail().getRechargeTime6m());
			activeDegreeDetail.setRechargeTimeAvg3m(numberReport.getActiveDegreeDetail().getRechargeTimeAvg3m());
			activeDegreeDetail.setRechargeTimeAvg6m(numberReport.getActiveDegreeDetail().getRechargeTimeAvg6m());

			activeDegreeDetail.setCallTime1m(numberReport.getActiveDegreeDetail().getCallTime1m());
			activeDegreeDetail.setCallTime3m(numberReport.getActiveDegreeDetail().getCallTime3m());
			activeDegreeDetail.setCallTime6m(numberReport.getActiveDegreeDetail().getCallTime6m());
			activeDegreeDetail.setCallTimeAvg3m(numberReport.getActiveDegreeDetail().getCallTimeAvg3m());
			activeDegreeDetail.setCallTimeAvg6m(numberReport.getActiveDegreeDetail().getCallTimeAvg6m());

			activeDegreeDetail.setSmsTime1m(numberReport.getActiveDegreeDetail().getSmsTime1m());
			activeDegreeDetail.setSmsTime3m(numberReport.getActiveDegreeDetail().getSmsTime3m());
			activeDegreeDetail.setSmsTime6m(numberReport.getActiveDegreeDetail().getSmsTime6m());
			activeDegreeDetail.setSmsTimeAvg3m(numberReport.getActiveDegreeDetail().getSmsTimeAvg3m());
			activeDegreeDetail.setSmsTimeAvg6m(numberReport.getActiveDegreeDetail().getSmsTimeAvg6m());

			activeDegreeDetail.setFlowTotal1m(numberReport.getActiveDegreeDetail().getFlowTotal1m());
			activeDegreeDetail.setFlowTotal3m(numberReport.getActiveDegreeDetail().getFlowTotal3m());
			activeDegreeDetail.setFlowTotal6m(numberReport.getActiveDegreeDetail().getFlowTotal6m());
			activeDegreeDetail.setFlowTotalAvg3m(numberReport.getActiveDegreeDetail().getFlowTotalAvg3m());
			activeDegreeDetail.setFlowTotalAvg6m(numberReport.getActiveDegreeDetail().getFlowTotalAvg6m());

			activeDegreeDetail.setFlowUsed1m(numberReport.getActiveDegreeDetail().getFlowUsed1m());
			activeDegreeDetail.setFlowUsed3m(numberReport.getActiveDegreeDetail().getFlowUsed3m());
			activeDegreeDetail.setFlowUsed6m(numberReport.getActiveDegreeDetail().getFlowUsed6m());
			activeDegreeDetail.setFlowUsedAvg3m(numberReport.getActiveDegreeDetail().getFlowUsedAvg3m());
			activeDegreeDetail.setFlowUsedAvg6m(numberReport.getActiveDegreeDetail().getFlowUsedAvg6m());

			activeDegreeDetail.setCallAvgDuration1m(numberReport.getActiveDegreeDetail().getCallAvgDuration1m());
			activeDegreeDetail.setCallAvgDuration3m(numberReport.getActiveDegreeDetail().getCallAvgDuration3m());
			activeDegreeDetail.setCallAvgDuration6m(numberReport.getActiveDegreeDetail().getCallAvgDuration6m());
		}
		activeDegreeDetail.setGmtCreate(Calendar.getInstance().getTime());
		activeDegreeDetailMapper.insertSelective(activeDegreeDetail);

		// 15消费统计 int_mx_consumption_detail
		IntMxConsumptionDetail consumpDetail = new IntMxConsumptionDetail();
		consumpDetail.setSerialNum(tokenId);
		consumpDetail.setLoanId(loanId);
		if (null != numberReport.getConsumptionDetail()) {
			consumpDetail.setTotalFee1m(numberReport.getConsumptionDetail().getTotalFee1m());
			consumpDetail.setTotalFee3m(numberReport.getConsumptionDetail().getTotalFee3m());
			consumpDetail.setTotalFee6m(numberReport.getConsumptionDetail().getTotalFee6m());
			consumpDetail.setTotalFeeAvg3m(numberReport.getConsumptionDetail().getTotalFeeAvg3m());
		}

		// consumpDetail.setTotalFeeAvg6m(numberReport.getConsumptionDetail().getTotalFeeAvg6m());
		if (null != numberReport.getConsumptionDetail()) {
			consumpDetail.setWebFee1m(numberReport.getConsumptionDetail().getWebFee1m());
			consumpDetail.setWebFee3m(numberReport.getConsumptionDetail().getWebFee3m());
			consumpDetail.setWebFee6m(numberReport.getConsumptionDetail().getWebFee6m());
			consumpDetail.setWebFeeAvg3m(numberReport.getConsumptionDetail().getWebFeeAvg3m());
			consumpDetail.setWebFeeAvg6m(numberReport.getConsumptionDetail().getWebFeeAvg6m());

			consumpDetail.setCallFee1m(numberReport.getConsumptionDetail().getCallFee1m());
			consumpDetail.setCallFee3m(numberReport.getConsumptionDetail().getCallFee3m());
			consumpDetail.setCallFee6m(numberReport.getConsumptionDetail().getCallFee6m());
			consumpDetail.setCallFeeAvg3m(numberReport.getConsumptionDetail().getCallFeeAvg3m());
			consumpDetail.setCallFeeAvg6m(numberReport.getConsumptionDetail().getCallFeeAvg6m());

			consumpDetail.setSmsFee1m(numberReport.getConsumptionDetail().getSmsFee1m());
			consumpDetail.setSmsFee3m(numberReport.getConsumptionDetail().getSmsFee3m());
			consumpDetail.setSmsFee6m(numberReport.getConsumptionDetail().getSmsFee6m());
			consumpDetail.setSmsFeeAvg3m(numberReport.getConsumptionDetail().getSmsFeeAvg3m());
			consumpDetail.setSmsFeeAvg6m(numberReport.getConsumptionDetail().getSmsFeeAvg6m());

			consumpDetail.setVasFee1m(numberReport.getConsumptionDetail().getVasFee1m());
			consumpDetail.setVasFee3m(numberReport.getConsumptionDetail().getVasFee3m());
			consumpDetail.setVasFee6m(numberReport.getConsumptionDetail().getVasFee6m());
			consumpDetail.setVasFeeAvg3m(numberReport.getConsumptionDetail().getVasFeeAvg3m());
			consumpDetail.setVasFeeAvg6m(numberReport.getConsumptionDetail().getVasFeeAvg6m());

			consumpDetail.setExtraFee1m(numberReport.getConsumptionDetail().getExtraFee1m());
			consumpDetail.setExtraFee3m(numberReport.getConsumptionDetail().getExtraFee3m());
			consumpDetail.setExtraFee6m(numberReport.getConsumptionDetail().getExtraFee6m());
			consumpDetail.setExtraFeeAvg3m(numberReport.getConsumptionDetail().getExtraFeeAvg3m());
			consumpDetail.setExtraFeeAvg6m(numberReport.getConsumptionDetail().getExtraFeeAvg6m());

			consumpDetail.setRechargeAmount1m(numberReport.getConsumptionDetail().getRechargeAmount1m());
			consumpDetail.setRechargeAmount3m(numberReport.getConsumptionDetail().getRechargeAmount3m());
			consumpDetail.setRechargeAmount6m(numberReport.getConsumptionDetail().getRechargeAmount6m());
			consumpDetail.setRechargeAmountAvg3m(numberReport.getConsumptionDetail().getRechargeAmountAvg3m());
			consumpDetail.setRechargeAmountAvg6m(numberReport.getConsumptionDetail().getRechargeAmountAvg6m());
		}
		consumpDetail.setGmtCreate(Calendar.getInstance().getTime());
		consumpDetailMapper.insertSelective(consumpDetail);
		return true;
	}

	// 运营商账单查询
	@Override
	public boolean obtainAllDataDetails(AllDataDetails allDataDetails, String tokenId, String loanId) throws Exception {

		// 01账户基本信息 int_mx_account_base_info
		IntMxAccountBaseInfo acctBaseInfo = new IntMxAccountBaseInfo();
		acctBaseInfo.setSerialNum(tokenId);
		acctBaseInfo.setLoanId(loanId);
		acctBaseInfo.setMobile(allDataDetails.getMobile());
		acctBaseInfo.setName(allDataDetails.getName());
		acctBaseInfo.setIdcard(allDataDetails.getIdcard());
		acctBaseInfo.setCarrier(allDataDetails.getCarrier());
		acctBaseInfo.setProvince(allDataDetails.getProvince());
		acctBaseInfo.setCity(allDataDetails.getCity());
		acctBaseInfo.setOpenTime(allDataDetails.getOpenTime());
		acctBaseInfo.setLevel(allDataDetails.getLevel());
		acctBaseInfo.setPackageName(allDataDetails.getPackageName());
		acctBaseInfo.setState(allDataDetails.getState());
		acctBaseInfo.setAvailableBalance(allDataDetails.getAvailableBalance());
		acctBaseInfo.setLastModifyTime(allDataDetails.getLastModifyTime());
		acctBaseInfo.setGmtCreate(Calendar.getInstance().getTime());
		acctBaseInfoMapper.insertSelective(acctBaseInfo);

		// 02套餐信息-套餐信息 int_mx_package_info
		IntMxPackageInfo packageInfo = new IntMxPackageInfo();
		// 02套餐信息-套餐明细 int_mx_package_items

		for (int i = 0; i < allDataDetails.getPackages().size(); i++) {

			packageInfo.setSerialNum(tokenId);
			packageInfo.setLoanId(loanId);
			packageInfo.setMobile(allDataDetails.getMobile());
			packageInfo.setBillStartDate(allDataDetails.getPackages().get(i).getBillStartDate());
			packageInfo.setBillEndDate(allDataDetails.getPackages().get(i).getBillEndDate());
			packageInfo.setCode(allDataDetails.getPackages().get(i).getCode());
			packageInfo.setMessage(allDataDetails.getPackages().get(i).getMessage());
			packageInfo.setGmtCreate(Calendar.getInstance().getTime());
			packageInfoMapper.insertSelective(packageInfo);

			// 写入明细子表
			List<IntMxPackageItems> intMxPackageItemsList = new ArrayList<IntMxPackageItems>();
			for (int j = 0; j < allDataDetails.getPackages().get(i).getItems().size(); j++) {
				IntMxPackageItems packageItems = new IntMxPackageItems();
				packageItems.setSerialNum(tokenId);
				packageItems.setLoanId(loanId);
				packageItems.setItem(allDataDetails.getPackages().get(i).getItems().get(j).getItem());
				packageItems.setTotal(allDataDetails.getPackages().get(i).getItems().get(j).getTotal());
				packageItems.setUsed(allDataDetails.getPackages().get(i).getItems().get(j).getUsed());
				packageItems.setUnit(allDataDetails.getPackages().get(i).getItems().get(j).getUnit());
				packageItems.setGmtCreate(Calendar.getInstance().getTime());
				intMxPackageItemsList.add(packageItems);

			}
			if (intMxPackageItemsList != null && intMxPackageItemsList.size() > 0) {
				packageItemMapper.insertSelective(intMxPackageItemsList);
			}
			intMxPackageItemsList.clear();
			intMxPackageItemsList = null;
		}

		// 03亲情网信息-亲情网号码 int_mx_familynet_number
		IntMxFamilynetNumber familyNetNum = new IntMxFamilynetNumber();

		List<IntMxFamilynetMember> intMxFamilynetMemberList = new ArrayList<IntMxFamilynetMember>();
		for (int i = 0; i < allDataDetails.getFamilies().size(); i++) {
			familyNetNum.setSerialNum(tokenId);
			familyNetNum.setLoanId(loanId);
			familyNetNum.setMobile(allDataDetails.getMobile());
			familyNetNum.setFamilyNum(allDataDetails.getFamilies().get(i).getFamilyNetNum());
			familyNetNum.setCode(allDataDetails.getFamilies().get(i).getCode());
			familyNetNum.setMessage(allDataDetails.getFamilies().get(i).getMessage());
			familyNetNum.setGmtCreate(Calendar.getInstance().getTime());
			familyNetNumMapper.insertSelective(familyNetNum);

			// 写入成员信息子表
			for (int j = 0; j < allDataDetails.getFamilies().get(i).getFamilyMembers().size(); j++) {
				// 03亲情网信息-亲情网成员 int_mx_familynet_member
				IntMxFamilynetMember familyNetMember = new IntMxFamilynetMember();
				familyNetMember.setSerialNum(tokenId);
				familyNetMember.setLoanId(loanId);
				familyNetMember.setLongNumber(
						allDataDetails.getFamilies().get(i).getFamilyMembers().get(j).getLongNumber());
				familyNetMember.setShortNumber(
						allDataDetails.getFamilies().get(i).getFamilyMembers().get(j).getShortNumber());
				familyNetMember.setMemberType(
						allDataDetails.getFamilies().get(i).getFamilyMembers().get(j).getMemberType());
				familyNetMember
						.setJoinDate(allDataDetails.getFamilies().get(i).getFamilyMembers().get(j).getJoinDate());
				familyNetMember.setExpireDate(
						allDataDetails.getFamilies().get(i).getFamilyMembers().get(j).getExpireDate());
				familyNetMember.setGmtCreate(Calendar.getInstance().getTime());
				intMxFamilynetMemberList.add(familyNetMember);

			}
			if (intMxFamilynetMemberList != null && intMxFamilynetMemberList.size() > 0) {
				familyNetMemberMapper.insertSelective(intMxFamilynetMemberList);
				intMxFamilynetMemberList.clear();
			}
		}
		intMxFamilynetMemberList = null;

		List<IntMxRecharge> intMxRechargeList = new ArrayList<IntMxRecharge>();
		List<IntMxRechargeItems> intMxRechargeItemsList = new ArrayList<IntMxRechargeItems>();
		/**
		 * 当前实体类存在问题，充值这部分实体类紊乱，充值记录、明细 没有父子关系，找不到充值记录父表的字段 待佩文解决 20170220
		 */
		for (int i = 0; i < allDataDetails.getRecharges().size(); i++) {
			// 04充值记录-充值记录 int_mx_recharge
			IntMxRecharge recharge = new IntMxRecharge();
			recharge.setSerialNum(tokenId);
			recharge.setLoanId(loanId);
			recharge.setMobile(allDataDetails.getMobile());
			// recharge.setCode(allDataDetails.getRecharges().get(i).getCode());
			// recharge.setMessage(allDataDetails.getRecharges().get(i).getMessage());
			recharge.setGmtCreate(Calendar.getInstance().getTime());
			intMxRechargeList.add(recharge);

			// 04充值记录-充值明细 int_mx_recharge_items
			IntMxRechargeItems rechargeItems = new IntMxRechargeItems();
			// for(int j=0;
			// j<allDataDetails.getRecharges().get(i).getRechargeDetail().size();
			// j++){
			rechargeItems.setSerialNum(tokenId);
			rechargeItems.setLoanId(loanId);
			rechargeItems.setDetailsId(allDataDetails.getRecharges().get(i).getDetailsId());
			rechargeItems.setRechargeTime(allDataDetails.getRecharges().get(i).getRechargeTime());
			rechargeItems.setAmount(allDataDetails.getRecharges().get(i).getAmount());
			rechargeItems.setType(allDataDetails.getRecharges().get(i).getType());
			rechargeItems.setGmtCreate(Calendar.getInstance().getTime());
			intMxRechargeItemsList.add(rechargeItems);
			// }
		}
		if (intMxRechargeList != null && intMxRechargeList.size() > 0) {
			rechargeMapper.insertSelective(intMxRechargeList);
		}
		if (intMxRechargeItemsList != null && intMxRechargeItemsList.size() > 0) {
			rechargeItemsMapper.insertSelective(intMxRechargeItemsList);
		}
		intMxRechargeList.clear();
		intMxRechargeList = null;
		intMxRechargeItemsList.clear();
		intMxRechargeItemsList = null;

		List<IntMxBillsMonth> intMxBillsMonthList = new ArrayList<IntMxBillsMonth>();
		for (int i = 0; i < allDataDetails.getBills().size(); i++) {
			// 05账单明细 int_mx_bills_month
			IntMxBillsMonth billMonth = new IntMxBillsMonth();
			billMonth.setSerialNum(tokenId);
			billMonth.setLoanId(loanId);
			billMonth.setOrderNum(i + 1);
			billMonth.setMobile(allDataDetails.getMobile());
			billMonth.setCode(allDataDetails.getBills().get(i).getCode());
			billMonth.setMessage(allDataDetails.getBills().get(i).getMessage());
			billMonth.setBillMonth(allDataDetails.getBills().get(i).getBillMonth());
			billMonth.setBillStartDate(allDataDetails.getBills().get(i).getBillStartDate());
			billMonth.setBillEndDate(allDataDetails.getBills().get(i).getBillEndDate());
			billMonth.setBaseFee(allDataDetails.getBills().get(i).getBaseFee());
			billMonth.setExtraServiceFee(allDataDetails.getBills().get(i).getExtraServiceFee());
			billMonth.setVoiceFee(allDataDetails.getBills().get(i).getVoiceFee());
			billMonth.setSmsFee(allDataDetails.getBills().get(i).getSmsFee());
			billMonth.setWebFee(allDataDetails.getBills().get(i).getWebFee());
			billMonth.setExtraFee(allDataDetails.getBills().get(i).getExtraFee());
			billMonth.setTotalFee(allDataDetails.getBills().get(i).getTotalFee());
			billMonth.setDiscount(allDataDetails.getBills().get(i).getDiscount());
			billMonth.setExtraDiscount(allDataDetails.getBills().get(i).getExtraDiscount());
			billMonth.setActualFee(allDataDetails.getBills().get(i).getActualFee());
			billMonth.setPaidFee(allDataDetails.getBills().get(i).getPaidFee());
			billMonth.setUnpaidFee(allDataDetails.getBills().get(i).getUnpaidFee());
			billMonth.setCurrentPoint(allDataDetails.getBills().get(i).getPoint());
			billMonth.setLastPoint(allDataDetails.getBills().get(i).getLastPoint());
			billMonth.setRelatedMobiles(allDataDetails.getBills().get(i).getRelatedMobiles());
			billMonth.setNotes(allDataDetails.getBills().get(i).getNotes());
			billMonth.setGmtCreate(Calendar.getInstance().getTime());
			intMxBillsMonthList.add(billMonth);

		}
		if (intMxBillsMonthList != null && intMxBillsMonthList.size() > 0) {
			billMonthMapper.insertSelective(intMxBillsMonthList);
		}
		intMxBillsMonthList.clear();
		intMxBillsMonthList = null;

		List<IntMxCallDetails> intMxCallDetailsList2 = new ArrayList<IntMxCallDetails>();
		List<IntMxCallDetails> intMxCallDetailsList = new ArrayList<IntMxCallDetails>();
		List<IntMxLocalCallDetailCount> intMxLocalCallDetailCountList = new ArrayList<IntMxLocalCallDetailCount>();
		List<IntMxMobileCallDetailCount> intMxMobileCallDetailCountList = new ArrayList<IntMxMobileCallDetailCount>();
		List<VoiceCall> voiceCallList = null;
		Map<String, String> mapLocation = new HashMap<String, String>();
		Map<String, String> mapMobile = new HashMap<String, String>();
		for (int i = 0; i < allDataDetails.getCalls().size(); i++) {

			// 06通话详情-语音通话记录 int_mx_calls
			IntMxCalls calls = new IntMxCalls();
			calls.setSerialNum(tokenId);
			calls.setLoanId(loanId);
			calls.setMobile(allDataDetails.getMobile());
			calls.setBillMonth(allDataDetails.getCalls().get(i).getBillMonthAllData());
			calls.setCode(allDataDetails.getCalls().get(i).getCode());
			calls.setMessage(allDataDetails.getCalls().get(i).getMessage());
			calls.setTotalSize(allDataDetails.getCalls().get(i).getTotalSize());
			calls.setGmtCreate(Calendar.getInstance().getTime());
			callMapper.insertSelective(calls);

			// if(Boolean.parseBoolean(thirdProperties.getIs_brusage_details_dg())){
			// 写入语音通话详情子表
			voiceCallList = allDataDetails.getCalls().get(i).getCallsAllData();

			if (CollectionUtils.isNotEmpty(voiceCallList)) {
				for (int j = 0; j < voiceCallList.size(); j++) {
					// 06通话详情-通话详情明细 int_mx_call_details
					IntMxCallDetails callDetail = new IntMxCallDetails();
					String location = voiceCallList.get(j).getLocation();
					if (StringUtils.isEmpty(mapLocation.get(location))) {// 统计6个月经常通话地点
						mapLocation.put(location, "1");
					} else {
						int count = Integer.parseInt(mapLocation.get(location));
						mapLocation.put(location, String.valueOf(count + 1));
					}
					String mobile = voiceCallList.get(j).getPeerNumber();
					if (StringUtils.isEmpty(mapMobile.get(mobile))) {// 统计6个月经常通话对象
						mapMobile.put(mobile, location + "," + "1");
					} else {
						int count = Integer.parseInt(mapMobile.get(mobile).split(",")[1]);
						mapMobile.put(mobile, location + "," + String.valueOf(count + 1));
					}
					callDetail.setSerialNum(tokenId);
					callDetail.setLoanId(loanId);
					callDetail.setDetailsId(
							allDataDetails.getCalls().get(i).getCallsAllData().get(j).getDetails_id());
					callDetail.setTime(allDataDetails.getCalls().get(i).getCallsAllData().get(j).getTime());
					callDetail.setPeerNumber(
							allDataDetails.getCalls().get(i).getCallsAllData().get(j).getPeerNumber());
					callDetail.setLocation(allDataDetails.getCalls().get(i).getCallsAllData().get(j).getLocation());
					callDetail.setLocationType(
							allDataDetails.getCalls().get(i).getCallsAllData().get(j).getLocationType());
					callDetail.setDuration(
							allDataDetails.getCalls().get(i).getCallsAllData().get(j).getDurationInSecond());
					callDetail.setDialType(allDataDetails.getCalls().get(i).getCallsAllData().get(j).getDialType());
					callDetail.setFee(allDataDetails.getCalls().get(i).getCallsAllData().get(j).getFee());
					callDetail.setGmtCreate(Calendar.getInstance().getTime());
					intMxCallDetailsList.add(callDetail);

					// try {
					// callDetailSubMapper.insertSelectiveSingle(callDetail);
					// } catch (Exception e) {
					// MarvelsLogUtil.getInstance().error(">>>>>>>>>>魔蝎用户通话记录详细单笔入库:"+e+",loanId:"+loanId);
					// }
//					if (DateUtil.daysOfTwo(DateUtil.strToDate(voiceCallList.get(j).getTime()), new Date()) < 15) {// 只存2周内的数据
//						intMxCallDetailsList2.add(callDetail);
//					}

				}
				voiceCallList.clear();
			}

			if (intMxCallDetailsList != null && intMxCallDetailsList.size() > 0) {
				callDetailSubMapper.insertSelective(intMxCallDetailsList);
				intMxCallDetailsList.clear();
			}
//			if (intMxCallDetailsList2 != null && intMxCallDetailsList2.size() > 0) {
//				callDetailMapper.insertSelective(intMxCallDetailsList2);
//				intMxCallDetailsList2.clear();
//			}
		}
		mapLocation = SortUtil.sortByValue(mapLocation);
		int countLocation = 0;
		for (String key : mapLocation.keySet()) {
			if (countLocation < 10) {
				IntMxLocalCallDetailCount intMxLocalCallDetailCount = new IntMxLocalCallDetailCount();
				intMxLocalCallDetailCount.setLoanId(loanId);
				intMxLocalCallDetailCount.setSerialNum(tokenId);
				intMxLocalCallDetailCount.setPlace(key);
				intMxLocalCallDetailCount.setCreatedBy("sys");
				intMxLocalCallDetailCount.setCreatedDate(new Date());
				intMxLocalCallDetailCount.setUpdatedBy("sys");
				intMxLocalCallDetailCount.setUpdatedDate(new Date());
				intMxLocalCallDetailCount.setNumberOfCalls(mapLocation.get(key));
				intMxLocalCallDetailCountList.add(intMxLocalCallDetailCount);
			} else {
				break;
			}
			countLocation++;
		}
		if (intMxLocalCallDetailCountList != null && intMxLocalCallDetailCountList.size() > 0) {
			intMxLocalCallDetailCountMapper.insertSelective(intMxLocalCallDetailCountList);
			intMxLocalCallDetailCountList.clear();
		}
		mapMobile = SortUtil.sortByValueSplit(mapMobile);

		int countMobile = 0;
		for (String key : mapMobile.keySet()) {
			if (countMobile < 10) {
				IntMxMobileCallDetailCount intMxMobileCallDetailCount = new IntMxMobileCallDetailCount();
				intMxMobileCallDetailCount.setLoanId(loanId);
				intMxMobileCallDetailCount.setSerialNum(tokenId);
				intMxMobileCallDetailCount.setPhone(key);
				String splitPlace = mapMobile.get(key).toString().split(",")[0];
				intMxMobileCallDetailCount.setPlace(splitPlace);
				intMxMobileCallDetailCount.setCreatedBy("sys");
				intMxMobileCallDetailCount.setCreatedDate(new Date());
				intMxMobileCallDetailCount.setUpdatedBy("sys");
				intMxMobileCallDetailCount.setUpdatedDate(new Date());
				intMxMobileCallDetailCount.setNumberOfCalls(mapMobile.get(key).toString().split(",")[1]);
				intMxMobileCallDetailCountList.add(intMxMobileCallDetailCount);
			} else {
				break;
			}
			countMobile++;
		}
		if (intMxMobileCallDetailCountList != null && intMxMobileCallDetailCountList.size() > 0) {
			intMxMobileCallDetailCountMapper.insertSelective(intMxMobileCallDetailCountList);
			intMxMobileCallDetailCountList.clear();
		}
		// }

		// 07短信详情-短信详情记录 int_mx_smses
		IntMxSmses sms = new IntMxSmses();

		if (Boolean.parseBoolean(ThirdPropertiesInitUtil.getThirdProperties().getIs_brusage_details_dg())) {
			List<IntMxSmsDetails> intMxSmsDetailsList = new ArrayList<IntMxSmsDetails>();
			for (int i = 0; i < allDataDetails.getSmses().size(); i++) {
				sms.setSerialNum(tokenId);
				sms.setLoanId(loanId);
				sms.setMobile(allDataDetails.getMobile());
				sms.setBillMonth(allDataDetails.getSmses().get(i).getBillMonthAllDate());
				sms.setCode(allDataDetails.getSmses().get(i).getCode());
				sms.setMessage(allDataDetails.getSmses().get(i).getMessage());
				sms.setTotalSize(allDataDetails.getSmses().get(i).getTotalSize());
				sms.setGmtCreate(Calendar.getInstance().getTime());
				smsSubMapper.insertSelective(sms);

				// 写入信息详情明细子表
				for (int j = 0; j < allDataDetails.getSmses().get(i).getRecordsAllDate().size(); j++) {
					// 07短信详情-短信详情明细 int_mx_sms_details
					IntMxSmsDetails smsDetail = new IntMxSmsDetails();
					smsDetail.setSerialNum(tokenId);
					smsDetail.setLoanId(loanId);
					smsDetail.setDetailsId(
							allDataDetails.getSmses().get(i).getRecordsAllDate().get(j).getDetailsId());
					smsDetail.setTime(allDataDetails.getSmses().get(i).getRecordsAllDate().get(j).getTime());
					smsDetail.setPeerNumber(
							allDataDetails.getSmses().get(i).getRecordsAllDate().get(j).getPeerNumber());
					smsDetail.setLocation(
							subStr(allDataDetails.getSmses().get(i).getRecordsAllDate().get(j).getLocation(), 15));
					smsDetail
							.setSendType(allDataDetails.getSmses().get(i).getRecordsAllDate().get(j).getSendType());
					smsDetail.setMsgType(allDataDetails.getSmses().get(i).getRecordsAllDate().get(j).getMsgType());
					smsDetail.setServiceName(
							allDataDetails.getSmses().get(i).getRecordsAllDate().get(j).getServiceName());
					smsDetail.setFee(allDataDetails.getSmses().get(i).getRecordsAllDate().get(j).getFee());
					smsDetail.setGmtCreate(Calendar.getInstance().getTime());
					intMxSmsDetailsList.add(smsDetail);
				}
				if (intMxSmsDetailsList != null && intMxSmsDetailsList.size() > 0) {
					smsDetailSubMapper.insertSelective(intMxSmsDetailsList);
					intMxSmsDetailsList.clear();
				}
			}
			intMxSmsDetailsList = null;
		}

		if (Boolean.parseBoolean(ThirdPropertiesInitUtil.getThirdProperties().getIs_brusage_details_dg())) {
			List<IntMxDataUsageDetails> intMxDataUsageDetailsList = new ArrayList<IntMxDataUsageDetails>();
			for (int i = 0; i < allDataDetails.getNets().size(); i++) {
				// 08网络使用详情-流量详情记录 int_mx_data_usage_month
				IntMxDataUsageMonth dataUsageM = new IntMxDataUsageMonth();
				dataUsageM.setSerialNum(tokenId);
				dataUsageM.setLoanId(loanId);
				dataUsageM.setMobile(allDataDetails.getMobile());
				dataUsageM.setBillMonth(allDataDetails.getNets().get(i).getBillMonth());
				/**
				 * 当前第三方接口实体类存在问题，这两个字段缺失，待佩文解决 20170220
				 */
				// dataUsageM.setCode(allDataDetails.getNets().get(i).getCode());
				// dataUsageM.setMessage(allDataDetails.getNets().get(i).getMessage());
				dataUsageM.setTotalSize(allDataDetails.getNets().get(i).getTotalSize());
				dataUsageM.setGmtCreate(Calendar.getInstance().getTime());
				dataUsageMSubMapper.insertSelective(dataUsageM);
				// 写入网络使用详情 明细子表

//				for (int j = 0; j < allDataDetails.getNets().get(i).getItems().size(); j++) {
//					// 08网络使用详情-流量详情明细 int_mx_data_usage_details
//					IntMxDataUsageDetails dataUsageDetail = new IntMxDataUsageDetails();
//					dataUsageDetail.setSerialNum(tokenId);
//					dataUsageDetail.setLoanId(loanId);
//					dataUsageDetail.setDetailsId(allDataDetails.getNets().get(i).getItems().get(j).getDetailsId());
//					dataUsageDetail.setTime(allDataDetails.getNets().get(i).getItems().get(j).getTime());
//					dataUsageDetail.setDuration(allDataDetails.getNets().get(i).getItems().get(j).getDuration());
//					dataUsageDetail.setLocation(allDataDetails.getNets().get(i).getItems().get(j).getLocation());
//					dataUsageDetail.setSubflow(allDataDetails.getNets().get(i).getItems().get(j).getSubflow());
//					dataUsageDetail.setNetType(allDataDetails.getNets().get(i).getItems().get(j).getNetType());
//					dataUsageDetail
//							.setServiceName(allDataDetails.getNets().get(i).getItems().get(j).getServiceName());
//					dataUsageDetail.setFee(allDataDetails.getNets().get(i).getItems().get(j).getFee());
//					dataUsageDetail.setGmtCreate(Calendar.getInstance().getTime());
//					intMxDataUsageDetailsList.add(dataUsageDetail);
//					if (j % 600 == 0 && j > 0) {// 600条插入一次
//						dataUsageDetailSubMapper.insertSelective(intMxDataUsageDetailsList);
//						intMxDataUsageDetailsList.clear();
//					}
//				}
				if (intMxDataUsageDetailsList != null && intMxDataUsageDetailsList.size() > 0) {
					dataUsageDetailSubMapper.insertSelective(intMxDataUsageDetailsList);
					intMxDataUsageDetailsList.clear();
				}
			}
		}
		return true;
	}

	// 公积金
	@Override
	public boolean obtainUserFundRecord(UserFundRecord userFundRecord, String tokenId, String loanId) throws Exception {

		// 01用户信息 int_mx_user_info
		IntMxUserInfo userInfo = new IntMxUserInfo();
		userInfo.setSerialNum(tokenId);
		userInfo.setLoanId(loanId);
		userInfo.setRealName(userFundRecord.getUserInfo().getRealName());
		userInfo.setGender(userFundRecord.getUserInfo().getGender());
		userInfo.setBirthday(userFundRecord.getUserInfo().getBirthday());
		userInfo.setMobile(userFundRecord.getUserInfo().getMobile());
		userInfo.setEmail(userFundRecord.getUserInfo().getEmail());
		userInfo.setCustomerNumber(userFundRecord.getUserInfo().getCustomerNumber());
		userInfo.setGjjNumber(userFundRecord.getUserInfo().getGjjNumber());
		userInfo.setBalance(userFundRecord.getUserInfo().getBalance());
		userInfo.setFundBalance(userFundRecord.getUserInfo().getFundBalance());
		userInfo.setSubsidyBalance(userFundRecord.getUserInfo().getSubsidyBalance());
		userInfo.setSubsidyIncome(userFundRecord.getUserInfo().getSubsidyIncome());
		userInfo.setPayStatus(userFundRecord.getUserInfo().getPayStatus());
		userInfo.setIdCard(userFundRecord.getUserInfo().getCertificateNumber());
		userInfo.setCardType(userFundRecord.getUserInfo().getCertificateType());
		userInfo.setHomeAddress(userFundRecord.getUserInfo().getHomeAddress());
		userInfo.setCorporationNumber(userFundRecord.getUserInfo().getCorporationNumber());
		userInfo.setCorporationName(userFundRecord.getUserInfo().getCorporationName());
		userInfo.setMonthlyCorporationIncome(userFundRecord.getUserInfo().getMonthlyCorporationIncome());
		userInfo.setMonthlyCustomerIncome(userFundRecord.getUserInfo().getMonthlyCustomerIncome());
		userInfo.setMonthlyTotalIncome(userFundRecord.getUserInfo().getMonthlyTotalIncome());
		userInfo.setCorporationRatio(userFundRecord.getUserInfo().getCorporationRatio());
		userInfo.setCustomerRatio(userFundRecord.getUserInfo().getCustomerRatio());
		userInfo.setSubsidyCorporationRatio(userFundRecord.getUserInfo().getSubsidyCorporationRatio());
		userInfo.setSubsidyCustomerRatio(userFundRecord.getUserInfo().getSubsidyCustomerRatio());
		userInfo.setBaseNumber(userFundRecord.getUserInfo().getBaseNumber());
		userInfo.setLastPayDate(userFundRecord.getUserInfo().getLastPayDate());
		userInfo.setBeginDate(userFundRecord.getUserInfo().getBeginDate());
		userInfo.setGmtCreate(Calendar.getInstance().getTime());
		userInfoMapper.insertSelective(userInfo);

		// 02账务详情 缴存记录 int_mx_bill_record
		IntMxBillRecord billRecord = new IntMxBillRecord();
		for (int i = 0; i < userFundRecord.getBillRecordList().size(); i++) {
			billRecord.setSerialNum(tokenId);
			billRecord.setLoanId(loanId);
			billRecord.setOutcome(userFundRecord.getBillRecordList().get(i).getOutcome());
			billRecord.setIncome(userFundRecord.getBillRecordList().get(i).getIncome());
			billRecord.setSubsidyOutcome(userFundRecord.getBillRecordList().get(i).getSubsidyOutcome());
			billRecord.setSubsidyIncome(userFundRecord.getBillRecordList().get(i).getSubsidyIncome());
			billRecord.setBalance(userFundRecord.getBillRecordList().get(i).getBalance());
			billRecord.setDealTime(userFundRecord.getBillRecordList().get(i).getDealTime());
			billRecord.setMonth(userFundRecord.getBillRecordList().get(i).getMonth());
			billRecord.setCorporationName(userFundRecord.getBillRecordList().get(i).getCorporationName());
			billRecord.setCorporationIncome(userFundRecord.getBillRecordList().get(i).getCorporationIncome());
			billRecord.setCustomerIncome(userFundRecord.getBillRecordList().get(i).getCustomerIncome());
			billRecord.setCorporationRatio(userFundRecord.getBillRecordList().get(i).getCorporationRatio());
			billRecord.setCustomerRatio(userFundRecord.getBillRecordList().get(i).getCustomerRatio());
			billRecord.setAdditionalIncome(userFundRecord.getBillRecordList().get(i).getAdditionalIncome());
			billRecord.setGmtCreate(Calendar.getInstance().getTime());
			billRecordMapper.insertSelective(billRecord);
		}

		// 03公积金贷款信息 int_mx_loan_info
		IntMxLoanInfo loanInfo = new IntMxLoanInfo();
		for (int i = 0; i < userFundRecord.getLoanInfoList().size(); i++) {
			loanInfo.setSerialNum(tokenId);
			loanInfo.setLoanId(loanId);
			loanInfo.setName(userFundRecord.getLoanInfoList().get(i).getName());
			loanInfo.setPhone(userFundRecord.getLoanInfoList().get(i).getPhone());
			loanInfo.setStatus(userFundRecord.getLoanInfoList().get(i).getStatus());
			loanInfo.setBank(userFundRecord.getLoanInfoList().get(i).getBank());
			loanInfo.setLoanType(userFundRecord.getLoanInfoList().get(i).getLoanType());
			loanInfo.setIdCard(userFundRecord.getLoanInfoList().get(i).getIdCard());
			loanInfo.setHouseAddress(userFundRecord.getLoanInfoList().get(i).getHouseAddress());
			loanInfo.setMailingAddress(userFundRecord.getLoanInfoList().get(i).getMailingAddress());
			loanInfo.setContractNumber(userFundRecord.getLoanInfoList().get(i).getContractNumber());
			loanInfo.setPeriods(userFundRecord.getLoanInfoList().get(i).getPeriods());
			loanInfo.setLoanAmount(userFundRecord.getLoanInfoList().get(i).getLoanAmount());
			loanInfo.setMonthlyRepayAmount(userFundRecord.getLoanInfoList().get(i).getMonthlyRepayAmount());
			loanInfo.setStartDate(userFundRecord.getLoanInfoList().get(i).getStartDate());
			loanInfo.setEndDate(userFundRecord.getLoanInfoList().get(i).getEndDate());
			loanInfo.setRepayType(userFundRecord.getLoanInfoList().get(i).getRepayType());
			loanInfo.setDeductDay(userFundRecord.getLoanInfoList().get(i).getDeductDay());
			loanInfo.setBankAccount(userFundRecord.getLoanInfoList().get(i).getBankAccount());
			loanInfo.setBankAccountName(userFundRecord.getLoanInfoList().get(i).getBankAccountName());
			loanInfo.setLoanInterestPercent(userFundRecord.getLoanInfoList().get(i).getLoanInterestPercent());
			loanInfo.setPenaltyInterestPercent(userFundRecord.getLoanInfoList().get(i).getPenaltyInterestPercent());
			loanInfo.setCommercialContractNumber(userFundRecord.getLoanInfoList().get(i).getCommercialContractNumber());
			loanInfo.setCommercialBank(userFundRecord.getLoanInfoList().get(i).getCommercialBank());
			loanInfo.setCommercialAmount(userFundRecord.getLoanInfoList().get(i).getCommercialAmount());
			loanInfo.setSecondBankAccount(userFundRecord.getLoanInfoList().get(i).getSecondBankAccount());
			loanInfo.setSecondBankAccountName(userFundRecord.getLoanInfoList().get(i).getSecondBankAccountName());
			loanInfo.setSecondIdCard(userFundRecord.getLoanInfoList().get(i).getSecondIdCard());
			loanInfo.setSecondPhone(userFundRecord.getLoanInfoList().get(i).getSecondPhone());
			loanInfo.setSecondCorporationName(userFundRecord.getLoanInfoList().get(i).getSecondCorporationName());
			loanInfo.setRemainAmount(userFundRecord.getLoanInfoList().get(i).getRemainAmount());
			loanInfo.setRemainPeriods(userFundRecord.getLoanInfoList().get(i).getRemainPeriods());
			loanInfo.setLastRepayDate(userFundRecord.getLoanInfoList().get(i).getLastRepayDate());
			loanInfo.setOverdueCapital(userFundRecord.getLoanInfoList().get(i).getOverdueCapital());
			loanInfo.setOverdueInterest(userFundRecord.getLoanInfoList().get(i).getOverdueInterest());
			loanInfo.setOverduePenalty(userFundRecord.getLoanInfoList().get(i).getOverduePenalty());
			loanInfo.setOverdueDays(userFundRecord.getLoanInfoList().get(i).getOverdueDays());
			loanInfo.setGmtCreate(Calendar.getInstance().getTime());
			loanInfoMapper.insertSelective(loanInfo);
		}

		// 04还款信息 贷款还款记录 int_mx_loan_repay_record
		IntMxLoanRepayRecord loanRepayRecord = new IntMxLoanRepayRecord();
		for (int i = 0; i < userFundRecord.getLoanRepayRecordList().size(); i++) {
			loanRepayRecord.setSerialNum(tokenId);
			loanRepayRecord.setLoanId(loanId);
			loanRepayRecord.setRepayDate(userFundRecord.getLoanRepayRecordList().get(i).getRepayDate());
			loanRepayRecord.setAccountingDate(userFundRecord.getLoanRepayRecordList().get(i).getAccountingDate());
			loanRepayRecord.setRepayAmount(userFundRecord.getLoanRepayRecordList().get(i).getRepayAmount());
			loanRepayRecord.setRepayCapital(userFundRecord.getLoanRepayRecordList().get(i).getRepayCapital());
			loanRepayRecord.setRepayInterest(userFundRecord.getLoanRepayRecordList().get(i).getRepayInterest());
			loanRepayRecord.setRepayPenalty(userFundRecord.getLoanRepayRecordList().get(i).getRepayPenalty());
			loanRepayRecord.setContractNumber(userFundRecord.getLoanRepayRecordList().get(i).getContractNumber());
			loanRepayRecord.setGmtCreate(Calendar.getInstance().getTime());
			loanRepayRecordMapper.insertSelective(loanRepayRecord);
		}

		return true;
	}
	/**
	 * 魔蝎运营商数据获取用户报告v2
	 */
	@Override
	public boolean obtainAllDataDetailsv2(MXReport mxReport, String tokenId, String loanId) throws Exception {

		List<MXBasicInfo> cellPhone = mxReport.getCellPhone();
		// 01账户基本信息 int_mx_account_base_info
		IntMxAccountBaseInfo acctBaseInfo = new IntMxAccountBaseInfo();
		acctBaseInfo.setSerialNum(tokenId);
		for (int i = 0; i < cellPhone.size(); i++) {
			if ("mobile".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setMobile(cellPhone.get(i).getValue());
			}
			if ("carrier_name".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setName(cellPhone.get(i).getValue());
			}
			if ("carrier_idcard".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setIdcard(cellPhone.get(i).getValue());
			}
			if ("reg_time".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setRegTime(cellPhone.get(i).getValue());
			}
			if ("in_time".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setInTime(cellPhone.get(i).getValue());
			}
			if ("email".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setEmail(cellPhone.get(i).getValue());
			}
			if ("address".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setAddress(cellPhone.get(i).getValue());
			}
			if ("reliability".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setReliability(cellPhone.get(i).getValue());
			}
			if ("phone_attribution".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setPhoneAttribution(cellPhone.get(i).getValue());
			}
			if ("live_address".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setLiveAddress(cellPhone.get(i).getValue());
			}
			if ("available_balance".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setAvailableBalance(cellPhone.get(i).getValue());
			}
			if ("bill_certification_day".equals(cellPhone.get(i).getKey())) {
				acctBaseInfo.setBillCertificationDay(cellPhone.get(i).getValue());
			}
		}
		acctBaseInfoMapper.updateMxAccountBaseInfo(acctBaseInfo);

		// 01用户基本信息-基础信息检查项
		IntMxBasicInfoCheckItems basicInfoCheck = new IntMxBasicInfoCheckItems();
		List<MXBasicCheckItem> mXBasicCheckItem = mxReport.getBasicCheckItems();
		basicInfoCheck.setSerialNum(tokenId);
		for (int i = 0; i < mXBasicCheckItem.size(); i++) {
			if ("idcard_check".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setIdcardCheck(mXBasicCheckItem.get(i).getResult());
			}

			if ("email_check".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setEmailChek(mXBasicCheckItem.get(i).getResult());
			}

			if ("address_check".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setAddressCheck(mXBasicCheckItem.get(i).getResult());
			}

			if ("call_data_check".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setCallDataCheck(mXBasicCheckItem.get(i).getResult());
			}

			if ("idcard_match".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setIdcardMatch(mXBasicCheckItem.get(i).getResult());
			}

			if ("name_match".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setNameMatch(mXBasicCheckItem.get(i).getResult());
			}

			if ("is_name_and_idcard_in_court_black".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setIsNameAndIdcardInCourtBlack(mXBasicCheckItem.get(i).getResult());
			}

			if ("is_name_and_idcard_in_finance_black".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setIsNameAndIdcardInFinanceBlack(mXBasicCheckItem.get(i).getResult());
			}

			if ("is_name_and_mobile_in_finance_black".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setIsNameAndMobileInFinanceBlack(mXBasicCheckItem.get(i).getResult());
			}

			if ("mobile_silence_3m".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setMobileSilence3m(mXBasicCheckItem.get(i).getResult());
			}

			if ("mobile_silence_6m".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setMobileSilence6m(mXBasicCheckItem.get(i).getResult());
			}

			if ("arrearage_risk_3m".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setArrearageRisk3m(mXBasicCheckItem.get(i).getResult());
			}

			if ("arrearage_risk_3m".equals(mXBasicCheckItem.get(i).getCheckItem())) {
				basicInfoCheck.setArrearageRisk6m(mXBasicCheckItem.get(i).getResult());
			}
		}

		basicInfoCheckMapper.updateMxBasicInfo(basicInfoCheck);

		// int_mx_call_analysis 从活跃程度分析项中取值
		List<MXApplicationPoint> mxApplicationPoints = mxReport.getActiveDegree();
		IntMxCallAnalysis intMxCallAnalysis = new IntMxCallAnalysis();
		intMxCallAnalysis.setLoanId(loanId);
		intMxCallAnalysis.setSerialNum(tokenId);
		if (mxApplicationPoints != null) {
			for (MXApplicationPoint mxApplicationPoint : mxApplicationPoints) {
				MXDetailItem mxDetailItem = mxApplicationPoint.getItem();
				if ("call_cnt".equals(mxApplicationPoint.getAppPoint())) {// 通话次数
					intMxCallAnalysis.setTotalNum1m(mxDetailItem.getItem1Month());
					intMxCallAnalysis.setTotalNum3m(mxDetailItem.getItem3Month());
					intMxCallAnalysis.setTotalNum6m(mxApplicationPoint.getItem().getItem6Month());
					intMxCallAnalysis.setTotalNumAvg3m(mxDetailItem.getAvgItem3Month());
					intMxCallAnalysis.setTotalNumAvg6m(mxDetailItem.getAvgItem6Month());
				}

				if ("call_time".equals(mxApplicationPoint.getAppPoint())) {// 通话时长（秒）
					intMxCallAnalysis.setTotalTime1m(mxDetailItem.getItem1Month());
					intMxCallAnalysis.setTotalTime3m(mxDetailItem.getItem3Month());
					intMxCallAnalysis.setTotalTime6m(mxApplicationPoint.getItem().getItem6Month());
					intMxCallAnalysis.setTotalTimeAvg3m(mxDetailItem.getAvgItem3Month());
					intMxCallAnalysis.setTotalTimeAvg6m(mxDetailItem.getAvgItem6Month());
				}

				if ("peer_num_cnt".equals(mxApplicationPoint.getAppPoint())) {// 通话号码数目
					intMxCallAnalysis.setTotalPeerNum1m(mxDetailItem.getItem1Month());
					intMxCallAnalysis.setTotalPeerNum3m(mxDetailItem.getItem3Month());
					intMxCallAnalysis.setTotalPeerNum6m(mxApplicationPoint.getItem().getItem6Month());
					intMxCallAnalysis.setTotalNumAvg3m(mxDetailItem.getAvgItem3Month());
					intMxCallAnalysis.setTotalNumAvg6m(mxDetailItem.getAvgItem6Month());
				}

				if ("dial_cnt".equals(mxApplicationPoint.getAppPoint())) {// 主叫次数
					intMxCallAnalysis.setTotalDialNum1m(mxDetailItem.getItem1Month());
					intMxCallAnalysis.setTotalDialNum3m(mxDetailItem.getItem3Month());
					intMxCallAnalysis.setTotalDialNum6m(mxApplicationPoint.getItem().getItem6Month());
					intMxCallAnalysis.setTotalDialNumAvg3m(mxDetailItem.getAvgItem3Month());
					intMxCallAnalysis.setTotalDialNumAvg6m(mxDetailItem.getAvgItem6Month());
				}

				if ("dialed_cnt".equals(mxApplicationPoint.getAppPoint())) {// 被叫次数
					intMxCallAnalysis.setTotalDialedNum1m(mxDetailItem.getItem1Month());
					intMxCallAnalysis.setTotalDialedNum3m(mxDetailItem.getItem3Month());
					intMxCallAnalysis.setTotalDialedNum6m(mxApplicationPoint.getItem().getItem6Month());
					intMxCallAnalysis.setTotalDialedNumAvg3m(mxDetailItem.getAvgItem3Month());
					intMxCallAnalysis.setTotalDialedNumAvg6m(mxDetailItem.getAvgItem6Month());
				}

				if ("dial_peer_num_cnt".equals(mxApplicationPoint.getAppPoint())) {// 被叫号码数
					intMxCallAnalysis.setTotalDialPeerNum1m(mxDetailItem.getItem1Month());
					intMxCallAnalysis.setTotalDialPeerNum3m(mxDetailItem.getItem3Month());
					intMxCallAnalysis.setTotalDialPeerNum6m(mxApplicationPoint.getItem().getItem6Month());
					intMxCallAnalysis.setTotalDialPeerNumAvg3m(mxDetailItem.getAvgItem3Month());
					intMxCallAnalysis.setTotalDialPeerNumAvg6m(mxDetailItem.getAvgItem6Month());
				}

				if ("dialed_peer_num_cnt".equals(mxApplicationPoint.getAppPoint())) {// 被叫号码数
					intMxCallAnalysis.setTotalDialedPeerNum1m(mxDetailItem.getItem1Month());
					intMxCallAnalysis.setTotalDialedPeerNum3m(mxDetailItem.getItem3Month());
					intMxCallAnalysis.setTotalDialedPeerNum6m(mxApplicationPoint.getItem().getItem6Month());
					intMxCallAnalysis.setTotalDialedPeerNumAvg3m(mxDetailItem.getAvgItem3Month());
					intMxCallAnalysis.setTotalDialedPeerNumAvg6m(mxDetailItem.getAvgItem6Month());
				}

				if ("peer_loc_cnt".equals(mxApplicationPoint.getAppPoint())) {// 通话号码归属地总数
					intMxCallAnalysis.setTotalCityNum1m(mxDetailItem.getItem1Month());
					intMxCallAnalysis.setTotalCityNum3m(mxDetailItem.getItem3Month());
					intMxCallAnalysis.setTotalCityNum6m(mxApplicationPoint.getItem().getItem6Month());
					intMxCallAnalysis.setTotalCityNumAvg3m(mxDetailItem.getAvgItem3Month());
					intMxCallAnalysis.setTotalCityNumAvg6m(mxDetailItem.getAvgItem6Month());
				}

			}
		}
		intMxCallAnalysisMapper.insertSelective(intMxCallAnalysis);

		
		// 用户黑名单信息（user_info_check.check_black_info）
		List<MXUserInfoCheck> userInfoCheck = mxReport.getUserInfoCheck(); 
		for (MXUserInfoCheck mxUserInfoCheck : userInfoCheck) {
			MXCheckBlackInfo checkBlackInfo = mxUserInfoCheck.getCheckBlackInfo(); 
			if(checkBlackInfo != null){
				IntMxCheckBlackInfo intMxCheckBlackInfo = new IntMxCheckBlackInfo();
				intMxCheckBlackInfo.setLoanId(loanId);
				intMxCheckBlackInfo.setSerialNum(tokenId);
				intMxCheckBlackInfo.setAgencyScore(checkBlackInfo.getPhoneGrayScore());
				intMxCheckBlackInfo.setDirectLinkmanBlackNum(checkBlackInfo.getContactsClass1BlacklistCnt());
				intMxCheckBlackInfo.setIndirectLinkmanBlackNum(checkBlackInfo.getContactsClass2BlacklistCnt());
				intMxCheckBlackInfo.setDirectLinkmanNum(checkBlackInfo.getContactsClass1Cnt());
				intMxCheckBlackInfo.setCauseDirectLinkmanNum(checkBlackInfo.getContactsRouterCnt());
				intMxCheckBlackInfo.setDirectCauseIndirectRate(checkBlackInfo.getContactsRouterRatio());
				intMxCheckBlackInfo.setCreatedBy("system");
				intMxCheckBlackInfo.setUpdatedBy("system");
				intMxCheckBlackInfo.setCreatedDate(new Date());
				intMxCheckBlackInfo.setUpdatedDate(new Date());
				intMxv2PersistenceMapper.insertCheckBlackInfo(intMxCheckBlackInfo); 
			}
			
			//用户查询信息（check_search_info）
			MXCheckSearchInfo mxCheckSearchInfo  = mxUserInfoCheck.getCheckSearchInfo();
			MarvelsLogUtil.getInstance().info("开始插入用户查询信息（check_search_info）,loanId="+loanId+",mxCheckSearchInfo="+mxCheckSearchInfo);
			if(mxCheckSearchInfo != null) {
				mxCheckSearchInfo.setLoanId(loanId);
				mxCheckSearchInfo.setArisedOpenWeb(ListToArray(mxCheckSearchInfo.getArisedOpenWebList()));
				mxCheckSearchInfo.setIdcardWithOtherNames(ListToArray(mxCheckSearchInfo.getIdcardWithOtherNamesList()));
				mxCheckSearchInfo.setIdcardWithOtherPhones(ListToArray(mxCheckSearchInfo.getIdcardWithOtherPhonesList()));
				mxCheckSearchInfo.setPhoneWithOtherIdcards(ListToArray(mxCheckSearchInfo.getPhoneWithOtherIdcardsList()));
				mxCheckSearchInfo.setPhoneWithOtherNames(ListToArray(mxCheckSearchInfo.getPhoneWithOtherNamesList()));
				mxCheckSearchInfo.setRegisterOrgType(ListToArray(mxCheckSearchInfo.getRegisterOrgTypeList()));
				mxCheckSearchInfo.setSearchedOrgType(ListToArray(mxCheckSearchInfo.getSearchedOrgTypeList()));
				mxCheckSearchInfo.setCreatedBy("system");
				mxCheckSearchInfo.setUpdatedBy("system");
				mxCheckSearchInfo.setCreatedDate(new Date());
				mxCheckSearchInfo.setUpdatedDate(new Date());
				mxCheckSearchInfo.setRegisterOrgCnt(mxCheckSearchInfo.getRegisterOrgCnt());
				mxCheckSearchInfo.setSearchedOrgCnt(mxCheckSearchInfo.getSearchedOrgCnt());
				
				 intMxCheckSearchInfoMapper.insertSelective(mxCheckSearchInfo);
			}
			MarvelsLogUtil.getInstance().info("完成插入用户查询信息（check_search_info）,loanId="+loanId);
		}
		
		//行为监测
		MarvelsLogUtil.getInstance().info("开始行为监测（int_mx_behavior_check）,loanId="+loanId);
		MarvelsLogUtil.getInstance().info("开始行为监测信息（int_mx_behavior_check）,loanId="+loanId+",data="+JSON.toJSONString(mxReport.getBehaviorCheck()));
		List<MXBehaviorCheck> behaviorCheckList = mxReport.getBehaviorCheck();
		try {
			if(CollectionUtils.isNotEmpty(behaviorCheckList)) {
				for(MXBehaviorCheck behaviorCheck : behaviorCheckList) {
					behaviorCheck.setCreatedBy("system");
					behaviorCheck.setUpdatedBy("system");
					behaviorCheck.setCreatedDate(new Date());
					behaviorCheck.setUpdatedDate(new Date());
					behaviorCheck.setLoanId(loanId);
					intMxBehaviorCheckMapper.insert(behaviorCheck);
				}
				
			}
		}catch(Exception e) {
			MarvelsLogUtil.getInstance().error("结束行为监测报错（int_mx_behavior_check）,loanId="+loanId,e);
		}
		MarvelsLogUtil.getInstance().info("结束行为监测（int_mx_behavior_check）,loanId="+loanId);
		return true;
	}

	/**
	 * 字符串List转为String
	 * wanggang
	 * @param list
	 * @return
	 */
	private String ListToArray(List<String> list) {
		if(CollectionUtils.isEmpty(list))
			return null;
		
		StringBuilder sb = new StringBuilder("");
		String data = null;
		for(int i=0;i<list.size()&&i<50; i++) {
			data = list.get(i);
			if(StringUtils.isNotBlank(data))
			sb.append(data).append(",");
		}
		
		if(sb.toString().contains(","))
			sb = sb.deleteCharAt(sb.lastIndexOf(","));
		
		return sb.toString();
	}
	
	@Override
	public boolean alipayReportV6(MXAlipayReport mxAlipayReport, String tokenId, String loanId, String message) throws Exception {
		Map<String, Object> alipayAuth = new HashMap<String, Object>();
		//基本信息
		MXAlipayUserInfo mxAlipayUserInfo = mxAlipayReport.getMxAlipayUserInfo();
		if(mxAlipayUserInfo != null){
			IntMxAlipayUserInfo intMxAlipayUserInfo = new IntMxAlipayUserInfo();
			BeanUtil.copyProperties(mxAlipayUserInfo, intMxAlipayUserInfo);
			intMxAlipayUserInfo.setLoanId(loanId);
			intMxAlipayUserInfo.setReqNo(tokenId);
			intMxAlipayUserInfo.setMessage(message);
			intMxAlipayUserInfoMapper.insertSelective(intMxAlipayUserInfo);
		}
		//资产信息
		MXAlipayWealth mxAlipayWealth = mxAlipayReport.getMxAlipayWealth();
		if(mxAlipayWealth != null){
			IntMxAlipayWealth intMxAlipayWealth = new IntMxAlipayWealth();
			BeanUtil.copyProperties(mxAlipayWealth, intMxAlipayWealth);
			intMxAlipayWealth.setLoanId(loanId);
			intMxAlipayWealth.setReqNo(tokenId);
			intMxAlipayWealthMapper.insertSelective(intMxAlipayWealth);
		}
		//银行卡信息
		List<MXAlipayBankInfo> mxAlipayBankInfos = mxAlipayReport.getMxAlipayBankInfos();
		if(mxAlipayBankInfos != null){
			for (MXAlipayBankInfo mxAlipayBankInfo : mxAlipayBankInfos) {
				IntMxAlipayBankInfo intMxAlipayBankInfo = new IntMxAlipayBankInfo();
				BeanUtil.copyProperties(mxAlipayBankInfo, intMxAlipayBankInfo);
				intMxAlipayBankInfo.setLoanId(loanId);
				intMxAlipayBankInfo.setReqNo(tokenId);
				intMxAlipayBankInfoMapper.insertSelective(intMxAlipayBankInfo);
			}
		}
		//联系人信息
		List<MXAlipayContacts> mxAlipayContacts = mxAlipayReport.getMxAlipayContacts();
		if(mxAlipayContacts != null){
			for (MXAlipayContacts mxAlipayContact : mxAlipayContacts) {
				IntMxAlipayContacts intMxAlipayContacts = new IntMxAlipayContacts();
				BeanUtil.copyProperties(mxAlipayContact, intMxAlipayContacts);
				intMxAlipayContacts.setLoanId(loanId);
				intMxAlipayContacts.setReqNo(tokenId);
				intMxAlipayContactsMapper.insertSelective(intMxAlipayContacts);
			}
		}
		//最近交易人
		List<MXAlipayRecentTraders> mxAlipayRecentTraders = mxAlipayReport.getMxAlipayRecentTraders();
		if(mxAlipayRecentTraders != null){
			for (MXAlipayRecentTraders mxAlipayRecentTrader : mxAlipayRecentTraders) {
				IntMxAlipayRecentTraders intMxAlipayRecentTraders = new IntMxAlipayRecentTraders();
				BeanUtil.copyProperties(mxAlipayRecentTrader, intMxAlipayRecentTraders);
				intMxAlipayRecentTraders.setLoanId(loanId);
				intMxAlipayRecentTraders.setReqNo(tokenId);
				intMxAlipayRecentTradersMapper.insertSelective(intMxAlipayRecentTraders);
			}
		}
		
		//借呗额度信息
		MXAlipayJieBei mxAlipayJieBei = mxAlipayReport.getMxAlipayJieBei();
		if(mxAlipayJieBei != null){
			IntMxAlipayJiebei intMXAlipayJieBei = new IntMxAlipayJiebei();
			BeanUtil.copyProperties(mxAlipayJieBei, intMXAlipayJieBei);
			intMXAlipayJieBei.setLoanId(loanId);
			intMXAlipayJieBei.setReqNo(tokenId);
			intMxAlipayJiebeiMapper.insertSelective(intMXAlipayJieBei);
		}
		
		//收货地址
		List<MXAlipayDeliverAddresses> mxAlipayDeliverAddresses = mxAlipayReport.getMxAlipayDeliverAddresses();
		if(mxAlipayDeliverAddresses != null){
			for (MXAlipayDeliverAddresses mxAlipayDeliverAddresse : mxAlipayDeliverAddresses) {
				IntMxAlipayDeliverAddresses intMxAlipayDeliverAddresses = new IntMxAlipayDeliverAddresses();
				BeanUtil.copyProperties(mxAlipayDeliverAddresse, intMxAlipayDeliverAddresses);
				intMxAlipayDeliverAddresses.setLoanId(loanId);
				intMxAlipayDeliverAddresses.setReqNo(tokenId);
				intMxAlipayDeliverAddressesMapper.insertSelective(intMxAlipayDeliverAddresses);
			}
		}
		//水电煤缴费信息
		List<MXAlipayJiaoFeiInfo> mxAlipayJiaoFeiInfos = mxAlipayReport.getMxAlipayJiaoFeiInfos();
		if(mxAlipayJiaoFeiInfos != null){
			for (MXAlipayJiaoFeiInfo mxAlipayJiaoFeiInfo : mxAlipayJiaoFeiInfos) {
				IntMxAlipayJiaofeiInfo intMxAlipayJiaofeiInfo = new IntMxAlipayJiaofeiInfo();
				BeanUtil.copyProperties(mxAlipayJiaoFeiInfo, intMxAlipayJiaofeiInfo);
				intMxAlipayJiaofeiInfo.setLoanId(loanId);
				intMxAlipayJiaofeiInfo.setReqNo(tokenId);
				intMxAlipayJiaofeiInfoMapper.insertSelective(intMxAlipayJiaofeiInfo);
			}
		}
		return true;
	}

	@Override
	public boolean alipayZmsReportV2(MXAlipayZmsReport mxAlipayZmsReport, String tokenId, String loanId)
			throws Exception {
		//真实芝麻分
		List<MXAlipayZmsCore> mxAlipayZmsCores = mxAlipayZmsReport.getMxAlipayZmsCores();
		if(mxAlipayZmsCores != null && mxAlipayZmsCores.size() > 0){
			for (MXAlipayZmsCore mxAlipayZmsCore : mxAlipayZmsCores) {
				IntMxAlipayZmsCore intMxAlipayZmsCore = new  IntMxAlipayZmsCore();
				BeanUtil.copyProperties(mxAlipayZmsCore, intMxAlipayZmsCore);
				intMxAlipayZmsCore.setLoanId(loanId);
				intMxAlipayZmsCore.setReqNo(tokenId);
				intMxAlipayZmsCoreMapper.insertSelective(intMxAlipayZmsCore);
			}
		}
		//存疑芝麻分信息
		MXAlipayZmsDoubtfulInfo mxAlipayZmsDoubtfulInfo = mxAlipayZmsReport.getMxAlipayZmsDoubtfulInfo();
		if(mxAlipayZmsDoubtfulInfo != null){
			IntMxAlipayZmsDoubtfulInfo intMxAlipayZmsDoubtfulInfo = new IntMxAlipayZmsDoubtfulInfo();
			BeanUtil.copyProperties(mxAlipayZmsDoubtfulInfo, intMxAlipayZmsDoubtfulInfo);
			intMxAlipayZmsDoubtfulInfo.setLoanId(loanId);
			intMxAlipayZmsDoubtfulInfo.setReqNo(tokenId);
			intMxAlipayZmsDoubtfulInfoMapper.insertSelective(intMxAlipayZmsDoubtfulInfo);
		}
		return true;
	}

}
